Upcoming SlideShare
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

# Saving this for later?

### Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Standard text messaging rates apply

# PHP - RAQ (Rarely Asked Questions!)

548
views

Published on

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

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

Published in: Technology

1 Comment
4 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
Views
Total Views
548
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
15
1
Likes
4
Embeds 0
No embeds

No notes for slide

### Transcript

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