Freshers Latest PHP Technical Interview Questions & Answers
Posted on 30th Nov -0001 12:00 AM
Advanced PHP online/classroom course, hyderabad: We Global I-Matrix Software Solutions are one of the best Web designing and development company in Hyderabad, India. If your search is for trust worthy developer then choose the best from our company. For more details Call Us 9000866292.mail us at :email@example.com
Freshers Latest PHP Technical Interview Questions & Answers 2014
What is the latest current version of PHP?
What are the differences between GET and POST methods in form submitting?
On the server side, the main difference between GET and POST is where the submitted is stored. The $_GET array stores data submitted by the GET method. The $_POST array stores data submitted by the POST method.
On the browser side, the difference is that data submitted by the GET method will be displayed in the browser’s address field. Data submitted by the POST method will not be displayed anywhere on the browser.
GET method is mostly used for submitting a small amount and less sensitive data.
POST method is mostly used for submitting a large amount or sensitive data.
Explain the different types of errors in PHP.
Notices, Warnings and Fatal errors are the types of errors in PHP
Notices represents non-critical errors, i.e. accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all but whenever required, you can change this default behavior.
Warnings are more serious errors but they do not result in script termination. i.e calling include() a file which does not exist. By default, these errors are displayed to the user.
Fatal errors are critical errors i.e. calling a non-existent function or class. These errors cause the immediate termination of the script.
What are the differences between require and include?
Both include and require used to include a file but when included file not found
Include send Warning where as Require send Fatal Error .
How to find current date and time?
The date() function provides you with a means of retrieving the current date and time, applying the format integer parameters indicated in your script to the timestamp provided or the current local time if no timestamp is given. In simplified terms, passing a time parameter is optional - if you don't, the current timestamp will be used. Where as time function returns current Unix timestamp.
How can we get second of the current time using date function?
$second = date("s");
How to increase the execution time of a php script?
To Change max_execution_time variable in php.ini file .By Default time is 30 seconds.
The file path is xampp/php/php.ini if xampp software is using.
What does a special set of tags do in PHP?
In PHP special tags the use of this Tags are The output is displayed directly to the browser.
What is meant by nl2br()?
Inserts HTML line breaks (
) before all newlines in a string.
What is use of header() function in php ? What is the limitation of HEADER()?
In PHP Important to notice the Limitation of HEADER() function is that header() must be called before any actual output is send. Means must use header function before HTML or any echo statement
There are Number of Use of HEADER() function in php like below
1> The header() function use to sends a raw HTTP header to a client.
2> We can use header() function for redirection of pages.
3> Used to refresh the page on given time interval automatically.
4> To send email header content like cc, bcc , reply to etc data and lot more
How can we know the total number of elements of Array?
If we just pass a simple var instead of a an array it will return 1.
Different Types of Tables in Mysql?
There are Five Types Tables in Mysql
What is the maximum length of a table name, a database name, or a field name in MySQL?
Database name: 64 characters
Table name: 64 characters
Column name: 64 characters
What is the difference between the functions unlink and unset?
unlink() deletes the given file from the file system.
unset() makes a variable undefined.
How can we convert asp pages to PHP pages?
There are lots of tools available for asp to PHP conversion. you can
search Google for that. the best one is available athttp://asp2php.naken.cc./
How can we set and destroy the cookie in php?
By using setcookie(name, value, expire, path, domain); function we can set the cookie in php ;
Set the cookies in past for destroy. like
setcookie("user", "sonia", time()+3600); for set the cookie
setcookie("user", "", time()-3600); for destroy or delete the cookies;
learn more about PHP and also who can learn php