Variable Concept in Functions of PHP : 3rd Day Lecture of PHP

Variable Concept in Functions of PHP

Sample 1 : Types of Variables in Functions

  1. Global Variables
  2. Local Variables
  3. Static Static Variables

Sample 2 : Define a function

My name is Samee_Ullah_Feroz
And my age is 22

   <html>  
     <head>  
       <title>Variable Concept in Functions of PHP : 3rd Day Lecture of PHP</title>  
     </head>  
     <body>  
       <h1 align="center">Variable Concept in Functions of PHP </h1>  
            <h2 align="left">Sample 1 : Types of Variables in Functions</h2>  
              <?php   
                          echo "<ol>  
                                    <li>Global Variables</li>  
                                    <li>Local Variables</li>  
                                    <li>Static Static Variables</li>  
                                    </ol>" // we use list here  
                          ?>  
          <h2 align="left">Sample 2 : Define a function</h2>  
               <?php   
                          $age=22; //It is Global Variable  
                               function bio()  
                                    {       
                                    $name = "Samee_Ullah_Feroz";  
                                    /* 2 Points Are Here  
                                    1) Use under score in the place of space  
                                    2) It is Local Variable  
                                    */  
                                    echo "My name is " . $name;  
                                    echo "<br />";  
                                    } #Local Variables Concept is finished at the end of the function  
                                         bio();  
                          /*It is every important, it is used to call function.   
                          1) Function is Declared  
                          2) then Function is called  
                          3) Variables Inside the function are "Local Variables"  
                          4) Variables out side the function are "Global Variables"  
                          */  
                          echo "And my age is {$age}" #Here I used curly brackets that I can not forget a minor rule of variable.  
                          ?>  
     </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