Escape Sequence in PHP "\" : 5th Day Lecture of PHP


escape in php

Escape Sequence in PHP "\"

Sample 1 : What is Escape Sequence?

Escape Sequence is the combination of escape symbol "\" and a letter coming after it.
Escape character "\" is used to show double quotes, dollar sign, single quote, back slash, curly brackets, or other brackets.
It works within double quotes. "" only.

Sample 2 : Types of Escape Sequences

I am going to describe 8 types of Escape Sequence
  1. \" = It is used to show a certain value within double quotes like "Sami"
  2. \" = It is used to show a certain value within single quote like \'Sami\'
  3. \n = It is used to transfer remaining characters in new line like Samee Ullah
    Feroz
  4. \t = It is used to add 3 spaces within two words or characters like Samee Ullah Feroz
  5. \r = It is used for courage Return like Samee Ullah Feroz
  6. \$ = It is used to show dollar sign as not the part of variable. like 1000 $
  7. \ = It is used to print a tractor as back slash not as escape character. like \Sami

Sample 3 : Example of \n , \t, \r Sequences.

Getting Error, I'll Resolve it tomorrow.Samee Ullah Feroz
Samee Ullah Feroz
Samee Ullah Feroz



 <html>  
      <head>  
           <title>Escape Sequence in PHP: 5th Day Lecture of PHP</title>  
      </head>  
      <body>  
           <h1 align="center">Escape Sequence in PHP "\"</h1>  
                <h2 align="left">Sample 1 : What is Escape Sequence?</h2>  
                     <!-- Brief Description of Escape Character-->  
                     <?php  
                          echo 'Escape Sequence is the combination of escape symbol "\" and a letter coming after it. <br />';  
                          echo 'Escape character "\" is used to show double quotes, dollar sign, single quote, back slash, curly brackets, or other brackets. <br />';  
                          echo 'It works within double quotes. "" only. <br />';  
                     ?>  
                <h2 align="left">Sample 2 : Types of Escape Sequences</h2>  
                     <?php   
                          echo '<b>I am going to describe 8 types of Escape Sequence </b> <br />';  
                          echo  
                               " <ol>  
                                    <li>\\\" = It is used to show a certain value within double quotes like \"Sami\"</li>  
                                    <li>\\\" = It is used to show a certain value within single quote like \'Sami\'</li>  
                                    <li>\\n = It is used to transfer remaining characters in new line like Samee Ullah<br/>Feroz</li>  
                                    <li>\\t = It is used to add 3 spaces within two words or characters like Samee Ullah Feroz</li>  
                                    <li>\\r = It is used for courage Return like Samee Ullah \rFeroz</li>  
                                    <li>\\\$ = It is used to show dollar sign as not the part of variable. like 1000 \$</li>  
                                    <li>\\ = It is used to print a tractor as back slash not as escape character. like \\Sami</li>  
                               </ol> ";  
                     ?>  
                <h2 align="left">Sample 3 : Example of \n , \t, \r Sequences.</h2>  
                     <?php  
                          echo "Getting Error, I'll Resolve it tomorrow.";  
                          $name1="Samee";  
                          $name2="Ullah";  
                          $name3="Feroz";  
                          echo "$name1 $name2\n$name3 <br />"; //Error Here Sequence is not working.  
                          echo "$name1 $name2\t$name3 <br />";  
                          echo "$name1 $name2\r$name3";  
                     ?>  
      </body>  
 </html>   

Share this article :

Post a Comment

Give your reviews about this blog. Leave your comments. What do you think about this post?

Comments Guidelines:

1) I love to read comments, but please avoid spam.

2) Like this blog, share your insights, and spread the word.

3) You can use basic HTML/xHTML tags.

4) All comments are DoFollow—please use the section professionally.

5) Kindly mention your name or brand below your comment.

6) Constructive suggestions for improvement are always welcome.

7) Do not forget to explore our main agency platform at pingbooster.site.

Thanks for visiting Samee Articles.

========================================

Explore custom digital solutions and WordPress plugins at PingBooster Plugins.

Best Regards,

Samee U. Feroz

 
Copyright © 2013-2016. Samee Articles - All Rights Reserved
Proudly powered by Blogger