Variable Functionality in PHP : 2nd Day Coding lecture

Variable Functionality

Variable Functionality

Sample 1 : Variables Use in Echo

I am going to use variables here

Sample 2 : Variable rules

  Variable Rules given bellow
  1. can be contained alpha numeric characters
  2. 1st character should contain underscore or alphabet
  3. 1st character can not be number or digit
  4. Try to ignore understand ( _ ) as 1st character of variable
    Because mostly major PHP personal variables start with underscore.
  5. Variable starts with Dollar Sign ($)
  6. Try to write variables in small latters
  7. Single File Variables Can not connect with other file variables.

Sample 3 : simple print veritable command

100

Sample 4 : Variables Adding Command

100+50+50 = is the right answer.
200 = is the right answer.

Sample 5 : Variable Replacing Rule

Getting Error In this Code, I'll modify tomorrow
What is Your Name?
My Name is samee.



   <html>  
     <head>  
       <title>Samee : Variable Functionality in PHP : 1st Day Coding lecture</title>  
     </head>  
     <body>  
       <h1 align="center">Variable Functionality</h1>  
         <h2 align="left">Sample 1 : Variables Use in Echo</h2>  
           <?php echo "I am going to use variables here" ?>  
         <h2 align="left">Sample 2 : Variable rules</h2>  
           <?php echo "Variable Rules given bellow <br/>  
                 <ol>  
                   <li>can be contained alpha numeric characters</li>  
                   <li>1st character should contain underscore or alphabet</li>  
                   <li>1st character can not be number or digit</li>  
                   <li>Try to ignore understand ( _ ) as 1st character of variable <br />  
                   Because mostly major php personal variables start with underscore. </li>  
                   <li>Variable starts with Dollar Sign ($)</li>  
                   <li>Try to write variables in small latters</li>  
                   <li>Single File Variables Can not connect with other file variables.</li> </ol>" //4th point is pointed by Teacher ?>  
          <h2 align="left">Sample 3 : simple print variable command</h2>  
            <?php $a=100;  
           echo "$a" #Here 100 is assigned to a ?>  
          <h2 align="left">Sample 4 : Variables Adding Command</h2>  
            <?php $a=100;  
               $b=50;  
               $c=50;  
               echo "$a+$b+$c = is the right answer. <br />" //values will be hold from above veriables ?>  
           <?php $a=100;  
               $b=50;  
               $c=50;  
               $d=$a+$b+$c;  
               echo "$d = is the right answer."  ?>  
          <h2 align="left">Sample 5 : Variable Replacing Rule</h2>  
          <?php echo "Getting Error In this Code, I'll modify tomorrow<br />"?>  
            <?php echo "<b>What is Your Name? </b><br />";  
               $name=100;  
               $name="samee";  
               echo "My Name is $name." ?>  
     </body>  
   </html>  

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.


Thanks for visiting Samee Articles.

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

Best Regards,

Samee U. Feroz

 
Copyright © 2011-2026. Samee Articles - All Rights Reserved
Proudly powered by Blogger