Posts Tagged with 'PHP'

 PHP | implode() and explode() function implode() function is use to convert an array into a string where as explode() function is used to convert an string into an array   implode() The implode() function …

Last updated 5 years ago | 5579 views

Tags:- PHP

PHP | Remove html tags from a string The strip_tags() function is use to remove any HTML, XML, and PHP tags from a string.   <?php echo strip_tags("Hello <b><i>world!</i></b>","<b>"); // Output will be Hello world! …

Last updated 5 years ago | 1717 views

Tags:- PHP

MySQL | Find last insert id in the table By using the MySQL function mysqli_insert_id() we can retrieve the last inserted id in the database table.   <?php $con = mysqli_connect("localhost","user_name","user_password","db_name"); if (mysqli_connect_errno()) { echo …

Last updated 5 years ago | 1307 views

Tags:- PHP PHP-MySQL

PHP | Upload File By using move_uploaded_file() function we can upload file in PHP.The move_uploaded_file() function moves an uploaded file to a new location. This function returns TRUE on success or FALSE on failure. move_uploaded_file(file,newloc) …

Last updated 5 years ago | 1215 views

Tags:- PHP

PHP | Recursion  PHP also supports recursive function call like C/C++. In such a case, a function calls itself within the function.   Note: Recursion must be incorporated carefully since it can lead to an …

Last updated 5 years ago | 1610 views

Tags:- PHP

PHP | htmlentities() The htmlentities() function is used to convert all applicable characters to HTML entities.   <?php $str = '<a href="http://www.studyzone4u.com">Let's GO</a>'; echo htmlentities($str); // output will be (source code) &lt;a href=&quot; http://www.studyzone4u.com &quot;&gt;Let's …

Last updated 5 years ago | 2327 views

Tags:- PHP

PHP |  date() function By using the PHP date() function we can find the current date and time. <?php echo date(“d-m-Y”); //This will print today date. echo date (“d-m-Y h:i:s”) // This will print today’s date …

Last updated 5 years ago | 1315 views

Tags:- PHP

PHP | isset() The isset () function is used to check whether a variable is set or not. It returns true if a variable is set otherwise it returns false.   <?php $var = "StudyZone4U.com"; …

Last updated 5 years ago | 1477 views

Tags:- PHP

PHP | Stop the execution of php script | exit() funtion By using exit() function we can stop the execution of php script.   <?php $a = 10; $b = 20; $c = $a+$b; exit(); …

Last updated 5 years ago | 4669 views

Tags:- PHP

PHP | Redirect PHP header() function is used to redirect a page to another page. It supplies raw HTTP headers to the browser and redirects it to another location. The redirection script should be at …

Last updated 5 years ago | 1337 views

Tags:- PHP

PHP | :: operator | scope resolution operator This operator is known as the scope resolution operator. And this operator is used to access the static members of the class. To access static members of a …

Last updated 5 years ago | 1118 views

Tags:- PHP

PHP |What is the difference between echo and print? PHP echo and print both are used to display the output in PHP. Both can be used with or without parenthesis. The differences are small echo …

Last updated 5 years ago | 1198 views

Tags:- PHP

strstr() and stristr() strstr() and stristr() both are use to find first occurence of a string, but the differences are strstr( ) is case sensitive where as stristr( ) is case insensitive.   strstr() – …

Last updated 5 years ago | 2300 views

Tags:- PHP

Enable errors in PHP There are two ways to enable error reporting in your PHP scripts: 1. You can add the following function in the the script: error_reporting(E_ALL); 2. You can add the following option in …

Last updated 5 years ago | 1299 views

Tags:- PHP

PHP | What is difference between == and === operator? "==" and "===" The two operators are known as comparison operators. "==" (i.e. equal)  and === (i.e. identical) both are use to check values are …

Last updated 5 years ago | 1283 views

Tags:- PHP