Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
 
<ul><li>/* Question No: 1 */ </li></ul><ul><li>What will be the output? </li></ul><ul><li>echo   0123 + 2; </li></ul>/* Pr...
<ul><li>/* Question No: 2 */ </li></ul><ul><li>What will be the output? </li></ul><ul><li>print   <<<Sania </li></ul><ul><...
<ul><li>/* Question No: 3 */ </li></ul><ul><li>What will be the output? </li></ul><ul><li>if( '10 out of 10'  == 10) { </l...
<ul><li>/* Question No: 4 */ </li></ul><ul><li>What will be the output? </li></ul><ul><li>echo   (int)   ((0.1 + 0.7) * 10...
<ul><li>/* Question No: 5 */ </li></ul><ul><li>What will be the output? </li></ul><ul><li>echo   'Testing ' . 1 + 2 . '45'...
<ul><li>/* Question No: 6 */ </li></ul><ul><li>What will be the output? </li></ul><ul><li>$num  = 10; </li></ul><ul><li>fu...
<ul><li>/* Question No: 7 */ </li></ul><ul><li>What will be the output? </li></ul><ul><li>function  myfunc( $argument ) { ...
<ul><li>/* Question No: 8 */ </li></ul><ul><li>What will be the output? </li></ul><ul><li>$date  =  '07/09/2008' ; </li></...
<ul><li>/* Question No: 9 */ </li></ul><ul><li>What will be the output when we run the below files  </li></ul><ul><li>(if ...
<ul><li>/* Question No: 10 */ </li></ul><ul><li>What will be the output? </li></ul><ul><li>$a  = array ( 'zero' , 'one' , ...
/* Results… */ If you answered correctly for more than 6 questions… /* Print result */ Your understanding level in PHP is ...
Suresh P [email_address]
Upcoming SlideShare
Loading in …5
×

PHP - RAQ (Rarely Asked Questions!)

819 views

Published on

I can say - You will surely learn something new in PHP after you gone through this presentation. :-)

Published in: Technology

PHP - RAQ (Rarely Asked Questions!)

  1. 2. <ul><li>/* Question No: 1 */ </li></ul><ul><li>What will be the output? </li></ul><ul><li>echo 0123 + 2; </li></ul>/* Print result */ 85
  2. 3. <ul><li>/* Question No: 2 */ </li></ul><ul><li>What will be the output? </li></ul><ul><li>print <<<Sania </li></ul><ul><li>&quot;‘Team, Learn PHP!'&quot; </li></ul><ul><li>Sania; </li></ul>/* Print result */ &quot;‘Team, Learn PHP!'&quot;
  3. 4. <ul><li>/* Question No: 3 */ </li></ul><ul><li>What will be the output? </li></ul><ul><li>if( '10 out of 10' == 10) { </li></ul><ul><li>echo 'equals to 10' ; </li></ul><ul><li>} </li></ul><ul><li>else { </li></ul><ul><li>echo 'not equals to 10' ; </li></ul><ul><li>} </li></ul>/* Print result */ equals to 10
  4. 5. <ul><li>/* Question No: 4 */ </li></ul><ul><li>What will be the output? </li></ul><ul><li>echo (int) ((0.1 + 0.7) * 10); </li></ul>/* Print result */ 7
  5. 6. <ul><li>/* Question No: 5 */ </li></ul><ul><li>What will be the output? </li></ul><ul><li>echo 'Testing ' . 1 + 2 . '45'; </li></ul>/* Print result */ 245
  6. 7. <ul><li>/* Question No: 6 */ </li></ul><ul><li>What will be the output? </li></ul><ul><li>$num = 10; </li></ul><ul><li>function multiply(){ </li></ul><ul><li>$num = $num * 10; </li></ul><ul><li>} </li></ul><ul><li>multiply(); </li></ul><ul><li>echo $num ; </li></ul>/* Print result */ 10
  7. 8. <ul><li>/* Question No: 7 */ </li></ul><ul><li>What will be the output? </li></ul><ul><li>function myfunc( $argument ) { </li></ul><ul><li>echo $argument + 10; </li></ul><ul><li>} </li></ul><ul><li>$variable = 10; </li></ul><ul><li>echo &quot;myfunc($variable) = &quot; . myfunc( $variable ); </li></ul>/* Print result */ 20myfunc(10) =
  8. 9. <ul><li>/* Question No: 8 */ </li></ul><ul><li>What will be the output? </li></ul><ul><li>$date = '07/09/2008' ; </li></ul><ul><li>print ereg_replace (&quot;([0-9]+)/([0-9]+)/([0-9]+)&quot;,&quot;//&quot; , $date ); </li></ul>/* Print result */ 09/07/2008
  9. 10. <ul><li>/* Question No: 9 */ </li></ul><ul><li>What will be the output when we run the below files </li></ul><ul><li>(if no_file.php does not exist in the server)? </li></ul><ul><li>/* use_include.php */ </li></ul><ul><li>include( 'no_file.php' ); </li></ul><ul><li>print 'This code will print on the page'; </li></ul><ul><li>/* use_require.php */ </li></ul><ul><li>require( 'no_file.php' ); </li></ul><ul><li>print 'This code will print on the page' ; </li></ul>/* Print result */ 1. will throw warning & print the statements 2. will throw fatal error & does not print the statement
  10. 11. <ul><li>/* Question No: 10 */ </li></ul><ul><li>What will be the output? </li></ul><ul><li>$a = array ( 'zero' , 'one' , 'two' ); </li></ul><ul><li>foreach ( $a as &$v ) { </li></ul><ul><li>} </li></ul><ul><li>foreach ( $a as $v ) { </li></ul><ul><li>} </li></ul><ul><li>print_r ( $a ); </li></ul>/* Print result */ Array ( [0] => zero [1] => one [2] => one )
  11. 12. /* Results… */ If you answered correctly for more than 6 questions… /* Print result */ Your understanding level in PHP is VERY GOOD! 
  12. 13. Suresh P [email_address]

×