Posts Tagged with 'PHP'

PHP | Start array index from 1 To change the array index start from 1 instead of 0 can be done using array_unshift() and unset() function. array_unshift() Function The array_unshift() function inserts new elements to …

Last updated 11 months, 1 week ago | 400 views

Tags:- PHP

PHP | Web Scraping Web scraping is used to get specific data from another website when there is no API available for it. There are many techniques for web scraping. You can read more about this …

Last updated 1 year, 1 month ago | 332 views

Tags:- PHP

Chart.JS | Draw Bar chart from server data using MySQL, Ajax, and PHP This example shows how to draw a bar chart with data from the database server.  FILE STRUCTURE At the end of this …

Last updated 1 year, 3 months ago | 1730 views

Tags:- HTML JQuery JavaScript PHP Chart Ajax PHP-MySQL

PHP | Warning: A non-numeric value encountered This error occurs when you are trying to do a mathematical operation on an integer with a nun-numeric value or a string.  Info: New E_WARNING and E_NOTICE errors …

Last updated 1 year, 6 months ago | 3232 views

Tags:- PHP

PHP | Comments A comment in PHP code is a line that is not executed as a part of the program. It's only read by someone who is looking at the code. By reading the comments …

Last updated 1 year, 7 months ago | 361 views

Tags:- PHP

PHP | Case Sensitive In PHP, keywords (e.g. if, else, while, echo, etc.), classes, functions, and user-defined functions are not case-sensitive but all variable names are case-sensitive.   If you defined function name in lowercase, …

Last updated 1 year, 7 months ago | 1221 views

Tags:- PHP

PHP | Syntax, and Tags PHP introduces a list of Tags to code PHP. PHP tags allow the PHP parsing engine to get in and get out from the PHP block. A PHP script can …

Last updated 1 year, 7 months ago | 346 views

Tags:- PHP

PHP | Statement $x = 3 + "15%" + "$25"? The correct answer is 18. Here’s why: PHP is a  loosely typed language, therefore it does automatic type conversion based on the context in which …

Last updated 1 year, 7 months ago | 357 views

Tags:- PHP

PHP | Array error fix | array_merge() The output will be as follows: array(2) { [0]=> int(1) [1]=> int(2) } NULL NULL It will also generate two warning messages as follows: Warning: array_merge(): Argument #2 …

Last updated 1 year, 7 months ago | 356 views

Tags:- PHP

PHP | Output of the following statements var_dump(0123 == 123); var_dump('0123' == 123); var_dump('0123' === 123   var_dump(0123 == 123) This will output bool(false) because the leading 0 in 0123 tells the PHP interpreter to treat the …

Last updated 1 year, 7 months ago | 396 views

Tags:- PHP

PHP | output of $a and $b once this code $a = '1'; $b = &$a; $b = "2$b" executed; Both $a and $b will output a string "21".   Because the statement $b = &$a; sets …

Last updated 1 year, 7 months ago | 358 views

Tags:- PHP

PHP | Get URL with Parameter To get the full URL of a current page with GET parameters, we use the $_SERVER global variable. We need the current URL to perform different types of works. For …

Last updated 1 year, 10 months ago | 2008 views

Tags:- PHP

SQL | IN operator with PHP Array In this article we will use PHP Array with SQL IN operator. SQL IN operator allows us to specify multiple values in where clause. So in this article …

Last updated 1 year, 10 months ago | 1058 views

Tags:- PHP PHP-MySQL

PHP | file_exists( ) Function The file's existence can be confirmed using the file_exist() function which takes the file name as an argument. file_exist("abc.jpg")   The file_exists() function is an inbuilt function in PHP that …

Last updated 1 year, 12 months ago | 657 views

Tags:- PHP

PHP | check whether a number is even or odd A trick to check whether a number is even or odd without using any condition or loop.   <?php $arr=array("0"=>"Even","1"=>"Odd"); $check=13; echo "Your number is: ".$arr[$check%2]; …

Last updated 1 year, 12 months ago | 470 views

Tags:- PHP