Wednesday, August 13, 2008

PHP Interview Questions in Photon Infotech

hai all,

Anybody know the PHP interview questions asked in Photon Infotech?

Sample question :

1. What is the uses and syntax of UCFIRST() function?
- ucfirst -- Make a string's first character uppercase
- Example :
$foo = 'hello world!';
$foo = ucfirst($foo); // Hello world!

$bar = 'HELLO WORLD!';
$bar = ucfirst($bar); // HELLO WORLD!
$bar = ucfirst(strtolower($bar)); // Hello world!
?>

2. How to get the current working browser using php code?
(i) Method 1: $_SERVER['HTTP_USER_AGENT']
Example :
if (substr_count(strtolower($_SERVER['HTTP_USER_AGENT']),"firefox"))/* Firefox browser*/
echo "My name's Firefox";
else if (substr_count(strtolower($_SERVER['HTTP_USER_AGENT']),"opera")) /* Opera browser */
echo "My name's Opera";
else if (substr_count(strtolower($_SERVER['HTTP_USER_AGENT']),"msie")) /* IE browser */
echo "My name's IE ";
else if (substr_count(strtolower($_SERVER['HTTP_USER_AGENT']),"safari")) /* Safari browser */
echo "My name's Safari";
else
echo "I don't know my name ";
?>

(ii) Method 2
- get_browser() built-in function in php
- get_browser -- Tells what the user's browser is capable of
- Example :
echo $_SERVER['HTTP_USER_AGENT'] . "\n";

$browser = get_browser();

foreach ($browser as $name => $value) {
echo "$name $value
\n";
}

?>

3. Worked projects related questions
4. Most of the question asked in php.ini setting
Example :
1. What is the maximum file size to upload by default?
- 2MB
2. What is the minimum session expiry time by default?
- session.cache_expire is 180 seconds

3. Necessity of md5 and its purpose?
4. Difference b/w PHP 4 and PHP 5?
5. PHP INI?
6. Different types of Payment gate way?
7. Different types of PHP Frame Works?

2 comments:

Anonymous said...

Hi

I read this post 2 times. It is very useful.

Pls try to keep posting.

Let me show other source that may be good for community.

Source: Sample interview questions

Best regards
Jonathan.

Unknown said...

any one find the job in php and web designing in Moahli...........
contact us
send me ur resume
rashma.kumari@bhanguz.com
hr@bhanguz.com

Popular Posts