PHP Interview Question Answer
What is the purpose of php.ini file?
php.ini is a default configuration file require for running application, we edit this as per our requirement
In xampp we can see this file on xampp->php->php.ini
Some php.ini setting we can do.
Increase memory limit
we can enable short tag
we can change max_execution_time
To enable or disable display error,log error,html error, log error ...
We can increase or decrease File uploading size
We can increase or decrease Maximum number of file upload
we can add/remove/comment extension like extension=php_mbstring.dll
How can we remove HTML Tags from Data?
How can we define a constant PHP?
define() is use to define constant
What is a Persistent Cookie?
A persistent cookie is permanently stored on Client computer this will create notepad file, But temporary cookie erased when we close broswer.
For Permanent cookie we use set_cookie()
For Temporary cookie we use $_SESSION
Full Form of PHP Open source softwares
XAMPP stands for Cross-Platform (X), Apache (A), MySQL (M), PHP (P) and Perl (P)
WAMP stands for Windows (W), Apache (A), MySQL (M) and PHP(P)
LAMP stands for Linux (L), Apache (A), MySQL (M) and PHP(P)
MacOS stands for MacOS (M), Apache (A), MySQL (M) and PHP(P)
Mysql Query to Find 2nd hightest salary from the employee table
SELECT DISTINCT salary FROM emp ORDER by salary desc LIMIT 1,1
SELECT MAX(salary) as salary FROM emp WHERE salary<(select MAX(salary) from emp);
SELECT salary FROM emp
WHERE salary = (SELECT (salary) FROM emp GROUP BY salary DESC LIMIT 1,1)
All above these query doing same work.
Swap two value without using third variable
What is the difference between == and === operator?
== equal operator is use to check two value is equal or not. If we use === operator then it will check two value is equal with same data type
What is default session time?
what is the difference between include and include_once?
Include We include file many times in single script. Include_once This will include file only one time, second if we include this file this will be ignore
List data types in PHP ?