Posts Tagged with 'PHP'

Constant in PHP The define() function is used to defining a constant in PHP define("GREETING", "Welcome to StudyZone4U.com");   Constants are like variables except that once they are defined they cannot be changed or undefined …

Last updated 6 years, 6 months ago | 2550 views

Tags:- PHP

The explode() and split() both function is use to split a string into an array. But the difference is explode() function splits a string into array by string where as Split function splits string into …

Last updated 6 years, 6 months ago | 2627 views

Tags:- PHP

$name and $$name both are variables but with a single difference that is $name is just a normal php variable where as $$name is known as reference variable. It allow you to use $name variable's …

Last updated 6 years, 6 months ago | 5587 views

Tags:- PHP

PHP | Add numbers of days to a date Simple and easy way to add some days in a given date using strtotime() function. <?php $p_date = "2019-01-10"; echo date('Y-m-d', strtotime($p_date . ' + 1 days')); echo …

Last updated 6 years, 9 months ago | 5967 views

Tags:- PHP

PHP | What are cookies in PHP? A cookie is a small piece of information store by the browser on the client location and sent to the server with every request. It stores a limited amount …

Last updated 7 years ago | 1926 views

Tags:- PHP

PHP | The maximum size of a file that can be uploaded using PHP The default maximum size of a file that can be uploaded using PHP is 2MB. upload_max_filesize = 2M; and we can …

Last updated 7 years ago | 2380 views

Tags:- PHP

PHP | max_execution_time directive in php.ini file By changing the value of  max_execution_time in the php.ini file max_execution_time = 30; // in second   By default, the maximum execution time for PHP scripts is set to …

Last updated 7 years ago | 2267 views

Tags:- PHP

Bellow code is used for the same $date1 = date(‘Y-m-d’); $date2 = ‘2006-08-15’; $days = (strtotime($date1) – strtotime($date2)) / (60 * 60 * 24); echo $days;  

Last updated 7 years ago | 1967 views

Tags:- PHP

PHP | Find the number of rows in a result set Bellow code is use for the same $sql = "SELECT * FROM table1"; $result = mysql_query($sql, $db_link); $num_rows = mysql_num_rows($result); echo $num_rows;  

Last updated 7 years ago | 2341 views

Tags:- PHP PHP-MySQL

Predefined classes in PHP are: Directory stdClass __PHP_Incomplete_Class exception php_user_filter

Last updated 7 years ago | 2866 views

Tags:- PHP

PHP | Count number of elements in an array There are two ways to find the number of elements in an array: 1. sizeof($arr), This function is an alias of count() echo sizeof($arr); 2. count($arr) echo …

Last updated 7 years ago | 2267 views

Tags:- PHP

PHP-MYSQL |  mysqli_fetch_assoc() VS  mysqli_fetch_array() mysqli_fetch_assoc() function fetch a result row as an associative array where as mysqli_fetch_array() function fetch a result row as an associative array, a numeric array, or both.       mysqli_fetch_assoc() The mysqli_fetch_assoc() …

Last updated 7 years ago | 6444 views

Tags:- PHP PHP-MySQL

PHP-MYSQL |  mysqli_fetch_object () VS  mysqli_fetch_array() mysqli_fetch_object()  fetch a result row as an object where as mysqli_fetch_array()  fetch a result row as an associative array, a numeric array, or both.       mysqli_fetch_object() The mysqli_fetch_object() function returns …

Last updated 7 years ago | 4544 views

Tags:- PHP

PHP-MYSQL |  Fetch Recoards From MySql table There are 4 ways: mysqli_fetch_row() - Get a result row as an enumerated array mysqli_fetch_array() - Fetch a result row as an associative array, a numeric array, or both mysqli_fetch_object() …

Last updated 7 years ago | 9242 views

Tags:- PHP PHP-MySQL

PHP-MySQL | Transaction with commit and rollback try { // First of all, let's begin a transaction $db->beginTransaction(); // A set of queries; if one fails, an exception should be thrown which we are handling at …

Last updated 7 years ago | 1737 views

Tags:- PHP PHP-MySQL