Posts Tagged with 'PHP'
What do you mean by the csrf_token?
The csrf_token is used for protection against Cross-Site Request Forgeries. This kind of attack takes place when a malicious website consists of a link, some JavaScript, or a form whose aim is to perform some …
What is an Interpreted language?
Interpreted language An Interpreted language executes its statements line by line. Languages such as Python, Javascript, R, PHP, and Ruby is a prime examples of Interpreted languages. Programs written in an interpreted language runs directly from …
How to start array index from 1 in 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 …
Web Scraping with 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 …
ChartJS | How to draw Bar chart from server data using MySQL, Ajax and 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 …
A non-numeric value encountered in PHP
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 …
Comments in 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 …
Is PHP a case sensitive language?
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, …
PHP Syntax and Tags
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 …
What will be the value of $x when given statement execute?
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 …
What are the errors in below code? What will be output and how can you fix it?
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 …
What will be the output of the following statements and why?
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 …
What will be the output of $a and $b once code bellow is executed?
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 …
Get full url in 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 …
How to use php array with sql IN operator?
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 …