interview php


PHP Interview Questions – PHP Interview Questions and Answers
Author: Administrator
Saved From: http://www.knowledgebase-script.com/demo/article-694.html
PHP Interview Questions – Here are some of the best PHP Interview Questions with Answers. This is a
platform where you can get everything about PHP Interview Questions & Answers.
1) What is the difference between strstr & stristr?
For strstr, the syntax is: string strstr(string $string,string $str ); The function strstr will search $str in $string. If
it finds the string means it will return string from where it finds the $str upto end of $string.
For Example:
$string = “http://yahoomail.com”;
$str=”yahoomail”;
The output is “yahoomail.com”. The main difference between strstr and stristr is of case sensitivity. The
former consider the case difference and later ignore the case difference.
2) What is the difference between explode and split?
Split function splits string into array by regular expression. Explode splits a string into array by string.
For Example:
explode(” and”, “India and Pakistan and Srilanka”);
split(” :”, “India : Pakistan : Srilanka”);
Both of these functions will return an array that contains India, Pakistan, and Srilanka.
3) How can you avoid execution time out error while fetching record from MySQL?
set_time_limit — Limits the maximum execution time
For Example:
set_time_limit(0);
If you set to 0 you say that there is not limit.
4) Write a SQL query that displays the difference between the highest and lowest salaries of a database table
“employees”. Label the column as DIFFERENCE.
Select max(sal)-min(sal) as Difference from employees;
5) What is the difference between require() and include()?

Advertisements

One thought on “interview php

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s