Posts Tagged with 'PHP'
What is php.ini and .htaccess file?
php.ini and .htaccess file Both php.ini and .htaccess file is the configuration file. php.ini: It is a configuration file for php setting. It is a special file by which you can make changes in PHP …
what are php magic fuction?
PHP | magic function In PHP all functions start with __ names are magical functions. Magical functions always live in a PHP class. The definition of the magical function is defined by the programmer itself. …
what is list in php?
List List is a language construct and is similar to an array. It is used to assign a list of variables in one operation. If you are using PHP 5, then the list values start …
what is Cross-site scripting?
Cross-site scripting (XSS) Cross-site scripting (XSS) is a type of computer security vulnerability typically found in web applications. XSS enables attackers to inject client-side script into web pages viewed by other users. A cross-site scripting …
What is the difference between explode() and implode() function?
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 …
How we can remove html tags from string?
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! …
How we can find last insert id in table?
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 …
How to upload file in PHP?
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) …
What is recursion in 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 …
What is use of htmlentities function in 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) <a href=" http://www.studyzone4u.com ">Let's …
How to find current date and time in 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 …
Why we use isset in 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"; …
How to stop execution of PHP script ?
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(); …
How to redirect a page in 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 …
What is :: operator and in what case we use it in 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 …