Subscribe To Our Newsletter

Sign Up Now To Get Free Coupon Codes, Event Coupon Codes Updates, Offers Updates. It's 100% Free!

We Hate Spam! Really, It's terrible and we never do it.

Some Important Functions of PHP : 5th Day Lecture of PHP : Samee


php strings

Some Important Functions of PHP

Sample 1 : strpos() Function Usage

As $name2 is "Feroz"
12
it will used to show the value location of starting $name2

Sample 2 : strlen() Function Usage

As $name1 is "Samee Ullah Feroz"
17= it will used to show the lenght of String $name1

Sample 3 : strtolower() Function Usage

samee ullah feroz

Sample 4 : strtoupper() Function Usage

SAMEE ULLAH FEROZ

Sample 5 : ucfirst() Function Usage

Samee ullah feroz

Sample 6 : ucwords() Function Usage

Samee Ullah Feroz

Sample 7 : implode() Function Usage

Samee_Ullah_Feroz

Sample 8 : explode() Function Usage

array (size=3)
  0 => string 'Samee' (length=5)
  1 => string 'Ullah' (length=5)
  2 => string 'Feroz' (length=5)

Sample 9 : substr() Function Usage


Ullah Feroz
Feroz
oz

Samee Ullah Feroz
Feroz
eroz
e Ullah Feroz

 <html>  
   <head>  
     <title>Some Important Functions of PHP : 5th Day Lecture : Samee</title>  
     <link rel="icon" type="image/ico" href="http://www.iconarchive.com/download/i50954/deleket/3d-cartoon-vol3/Web-Coding.ico" alt="Icon" />  
     <link type="text/css" href="http://www.getacho.com/download/phpcss/stylesheet.css" rel="stylesheet" />  
   </head>  
   <body>  
        <img id="logo" src="http://icons.iconarchive.com/icons/deleket/3d-cartoon-vol3/256/Web-Coding-icon.png" alt="Coding">  
     <h1 align="center">Some Important Functions of PHP : <a href="http://sameearticles.blogspot.com" target="_blank">Samee Articles</a></h1>  
       <h2 align="left">Sample 1 : strpos() Function Usage</h2>  
         <?php  
                          $name1 = "Samee Ullah Feroz";  
                          $name2 = "Feroz";  
                          echo 'As $name2 is "Feroz"<br />';  
                          echo strpos($name1, $name2) . "<br />it will used to show the value location of starting \$name2"  
         ?>  
       <h2 align="left">Sample 2 : strlen() Function Usage</h2>  
         <?php  
                          $name1 = "Samee Ullah Feroz";  
                          $name2 = "Feroz";  
                          echo 'As $name1 is "Samee Ullah Feroz"<br />';  
                          echo strlen("$name1") . "=\tit will used to show the lenght of String \$name1";  
                          //And We can also write Full Name in the place of $name1 and also we can write string either with double qoutes or without qoutes  
         ?>  
       <h2 align="left">Sample 3 : strtolower() Function Usage</h2>  
         <?php  
                          $name1 = "Samee Ullah Feroz";  
                          $name2 = "Feroz";  
                          echo strtolower($name1); //As it is used to convert all letters to lower case.  
         ?>  
       <h2 align="left">Sample 4 : strtoupper() Function Usage</h2>  
         <?php  
                          $name1 = "Samee Ullah Feroz";  
                          $name2 = "Feroz";  
                          echo strtoupper($name1); //As it is used to Convert all letters to upper case (Capital Letters)  
         ?>  
       <h2 align="left">Sample 5 : ucfirst() Function Usage</h2>  
         <?php  
                          $name1 = "samee ullah feroz";  
                          $name2 = "Feroz";  
                          echo ucfirst($name1); //As it is used to Convert 1st letter to upper case (Capital Letter)  
         ?>  
       <h2 align="left">Sample 6 : ucwords() Function Usage</h2>  
         <?php  
                          $name1 = "samee ullah feroz";  
                          $name2 = "Feroz";  
                          echo ucwords($name1); //As it is used to Convert each 1st letter to upper case (Capital Letters)  
         ?>  
       <h2 align="left">Sample 7 : implode() Function Usage</h2>  
         <?php  
                          $name1 = array("Samee","Ullah","Feroz");  
                          $name2 = "Feroz";  
                          echo implode("_",$name1); //As it is used to join the array values and add specific charactor among each value.  
         ?>  
       <h2 align="left">Sample 8 : explode() Function Usage</h2>  
         <?php  
                          $name1 = "Samee Ullah Feroz";  
                          $name2 = "Feroz";  
                          $name3 = explode(" ",$name1);  
                          var_dump($name3);  
         ?>  
       <h2 align="left">Sample 9 : substr() Function Usage</h2>  
         <?php  
                          echo substr("Samee Ullah Feroz",18)."<br />";  
                          echo substr("Samee Ullah Feroz",6)."<br />";  
                          echo substr("Samee Ullah Feroz",11)."<br />";  
                          echo substr("Samee Ullah Feroz",15)."<br />";  
                          echo "<br>";  
                          // Negative numbers:  
                          echo substr("Samee Ullah Feroz",-18)."<br />";  
                          echo substr("Samee Ullah Feroz",-6)."<br />";  
                          echo substr("Samee Ullah Feroz",-4)."<br />";  
                          echo substr("Samee Ullah Feroz",-13)."<br />";  
         ?>  
   </body>  
 </html>  


Share this article :

Post a Comment

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

Meet Samee Ullah Feroz On Google Plus
Comments Description is given below:
1) I love to read comments, but do not spam.
2) Like this blog and also tweet its posts.
3) You can use some xHTML tags.
4) All Comments are Do Follow, Please try to use blog professionally.
5) Mention Your Name below the comment.
6) You can also suggest for improvement.
7) Do not forget to subscribe Samee Articles blog.

---------------------------------------
Thanks for visiting QWC.Me.
==========================================
For free guidelines contact me on SEO Expert | Samee Ullah Feroz is online there.
==========================================
Best Regards

 
Support : | Internet Marketing Specialist And Business Developer
Copyright © 2013-2016. Samee Articles - All Rights Reserved
Proudly powered by Blogger