PHP Quiz

Posted by Stephen thangaraj at 16:45
What Are the Special Characters
What Are the Special Characters You Need to Escape in Single-Quoted Stings?
There are two special characters you need to escape in a single-quote string: the single quote (') and the back slash (\). Here is a PHP script example of single-quoted strings:
<?php 
echo 'Hello world!'; 
echo 'It\'s Friday!'; 
echo '\\ represents an operator.'; 
?>
This script will print:
1.Hello world!It's Friday!\ represents an operator.                .
  Hello world!It\'s Friday!\ represents an operator.          
 
2.Hello world!It's Friday!\\ represents an operator
    Hello world!It/'s Friday!/represents an operator.

2.Can You Specify the "new line" Character in Single-Quoted Strings?
 <?php
echo '\n will work or not work in single quoted strings.'; 
?>
This script will print:
1.\n will work or not work in single quoted strings.         2. print new line will work or not work in single quoted strings.
3.What Are the Special Characters You Need to Escape in Double-Quoted Stings?
<?php 
echo "Hello world!"; 
?>
This script will print:
1.echo "Tom said: \"Who's there?\"";      
   echo "\\ represents an operator.";     
 
2.echo "Tom said: \\"Who's there?\\""; 
  echo "\ represents an operator.";   
4.How Many Escape Sequences Are Recognized in Double-Quoted Strings?
1.12                      2.9
3.45                      4.67
5.How To Include Variables in Double-Quoted Strings?
1.echo "part 1 $variable part 2\n"; 
 
2.echo "part 1 ".$variable." part 2\n";
3. 1 and 2

6.How to Concatenate Two Strings Together?
1.-            2.concatination()
3.+           4. - and concatination()
Click Here! Click Here! Click Here!
ReviewMe
Your Score:


If you enjoyed this post and wish to be informed whenever a new post is published, then make sure you subscribe to my regular Email Updates. Subscribe Now!


Kindly Bookmark and Share it:

YOUR ADSENSE CODE GOES HERE

0 comments:

Have any question? Feel Free To Post Below:

 

© 2011. All Rights Reserved | Interview Questions | Template by Blogger Widgets

Home | About | Top