PHP Interview: Facing Interview for PHP Jobs. PHP is widely used open-source free Program widely used in designing and development of the website .
PHP language for designing and development of dynamic websites. A website that can be CMS or dynamic mean you have control to change, update and content of the website. Facing Php interview questions means that you have knowledge of Data Structure, C, C++, Algorithms and more then it you need to have knowledge of how to create a database, how to put content, how to make reasoning so PHP Interview Questions Can be tough. So make it easy for you we make a List of PHP Interview Questions that help you in getting a job in a reputed company as a Software Engineer.
Mostly Asked SEO Interview Questions
The PHP Hypertext Preprocessor is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web-based software applications.
What Is a Session?
A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests.
There is only one session object available to your PHP scripts at any time. Data saved to the session by a script can be retrieved by the same script or another script when requested from the same visitor.
Sessions are commonly used to store temporary data to allow multiple PHP pages to offer a complete functional transaction for the same visitor.
What is meant by PEAR in PHP?
PEAR is the next revolution in PHP. This repository is bringing higher level programming to PHP. PEAR is a framework and distribution system for reusable PHP components. It eases installation by bringing an automated wizard and packing the strength and experience of PHP users into a nicely organised OOP library. PEAR also provides a command-line interface that can be used to automatically install “package
What is the difference between $message and $$message?
$message is a simple variable whereas $$message is a reference variable. Example:
$user = ‘bob’
is equivalent to
$holder = ‘user’;
$$holder = ‘bob’;
What are the differences between DROP a table and TRUNCATE a table?
DROP TABLE table_name – This will delete the table and its data.
TRUNCATE TABLE table_name – This will delete the data of the table, but not the table definition.
How do you call a constructor for a parent class?
WHAT ARE THE DIFFERENT TYPES OF ERRORS IN PHP?
Here are three basic types of runtime errors in PHP:
1. Notices: These are trivial, non-critical errors that PHP encounters while executing a script – for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all – although you can change this default behavior.
2. Warnings: These are more serious errors – for example, attempting to include() a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination.
3. Fatal errors: These are critical errors – for example, instantiating an object of a non-existent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHP’s default behavior is to display them to the user when they take place.
Internally, these variations are represented by twelve different error types
What’s the special meaning of __sleep and __wakeup?
__sleep returns the array of all the variables than need to be saved, while __wakeup retrieves them.
How can we submit a form without a submit button?
What is the functionality of the MD5 function in PHP?
It calculates the MD5 hash of a string. The hash is a 32-character hexadecimal number.
How can I load data from a text file into a table?
The MySQL provides a LOAD DATA INFILE command. You can load data from a file. Great tool but you need to make sure that:
a) Data must be delimited
b) Data fields must match table columns correctly
Who is known as Father of PHP
How can we know the number of days between two given dates using MySQL?
How can we change the name of a column of a table?
This will change the name of the column:
ALTER TABLE table_name CHANGE old_colm_name new_colm_name
- How can we change the data type of a column of a table?
This will change the data type of a column:
- What are the differences between getting and post methods in form submitting, give the case where we can use get and we can use post methods?
- Who is the father of PHP and explain the changes in PHP versions?
- How can we submit a form without a submit button?
- In how many ways we can retrieve the data in the result set of MySQL using PHP?
- What is the difference between mysql_fetch_object and mysql_fetch_array?
- What is the difference between $message and $$message?
- How can we extract string ‘techinterviews.com ‘ from a string ‘http://www.techinterviews.com’ using regular expression of PHP?
- How can we create a database using PHP and MySQL?
- What are the differences between require and include, include_once?
- What are the different types of errors in PHP?
- What is the functionality of the function strstr and stristr?
- What are the differences between PHP 3 and PHP 4 and PHP 5?
- How can we convert asp pages to PHP pages?
- What is the functionality of the function htmlentities?
- How can we get the second of the current time using date function?
- How can we convert the time zones using PHP?