Featured Post Today
print this page
Latest Post

Boolean, Arrays, null value in PHP Brief Description : 4th Day Lecture


boolean, array, null value

Boolean, Arrays, null value in PHP Brief Description

Sample 1 : PHP Booleans Brief Description

Boolean can be either TRUE or False. i.e.
$x=true
$y=false
Simple Code to show of Boolean rule:
my name is "Noor"

Sample 2 : PHP Arrays Brief Description

An array is used to store multiple values in a single Variable.
Arrays are useful when you want to store a group of data.
array (size=3)
  0 => string 'sameeullahferoz' (length=15)
  1 => int 22
  2 => float 5.3

specific datatype in array.
My Height is 5.3

Sample 3 : null Values Variable in PHP

null
samee



 <html>  
      <head>  
           <title>Boolean, Arrays, null value Brief Description : 4th Day Lecture of PHP</title>  
      </head>  
      <body>  
           <h1 align="center">Boolean, Arrays, null value in PHP Brief Description</h1>  
                <h2 align="left">Sample 1 : PHP Boolean Brief Description</h2>  
                     <?php  
                          echo "Booleans can be either TRUE or False. i.e. <br />";  
                          echo '$x=true <br />';  
                          echo '$y=false <br />';  
                     ?>  
                     <?php echo "Simple Code to show of Boolean rule: <br />" ?>  
                     <?php  
                          $istrue = false;  
                          if($istrue)  
                               {  
                          echo "my name is \"Samee\"";  
                               } // if $istrue variable was true, then it will be run. otherwise never.  
                          else  
                               {  
                          echo "my name is \"Noor\""; #backslash is used to give output of double quotes.  
                               }  
                     ?>  
                <h2 align="left">Sample 2 : PHP Arrays Brief Description</h2>  
                     <?php  
                          echo "An array is used to store multiple values in a single Variable. <br />";  
                     ?>  
                          <!-- An Example of PHP Arrays -->
    <?php
     $bio=array("sameeullahferoz",22,5.3); //it is round braces not square bracket. 
     //In Array values are counted as 0, 1, 2, like it.
     var_dump($bio); //to show the types and values of arrays.
     echo "<br />";
     echo "specific datatype in array. <br />";
     echo "My Height is {$bio[2]}"; //it is used to call value from arrage
    ?>
    
   <h2 align="left">Sample 3 : null Values Variable in PHP</h2>
    <?php
    $name=null;
    var_dump($name);
    
    $name="samee";
    echo $name
    ?>
 </body>
</html> 


0 comments

Some Important Things of Data Type: 4th Day Lecture of PHP


php data type

Some Important Things of Data Type in PHP

Sample 1 : Which is Faster way to print?

My General Name is Samee Ullah Feroz.
My General Company Name is Getacho.

Sample 2 : Rules for Integers

An integer must have at least one digit from 0 to 9.
An Integer cann't contain comma, space or blanks.
And Integer must have not a decimal point.
An Integer can be either positive or negative.
Integers can be specified in three formates:
  1. Decimal (10-based)
  2. Hexadecimal (16-based-prefixed with 0x)
  3. Octal (8-based-prefixed with 0)

Sample 3 : Var_dump variable usage

var_dump is a variable to show the integer type, value and size.
var_dump also add a break line in output.
var_dump Example:
50
int 50
float 100.5
string 'values' (length=6)

Sample 4 : Floating Points Numbers

float 10.365

float 2400

float 8.0E-5 



 <html>  
      <head>  
           <title>Some Important Things for Data Type: 4th Day Lecture of PHP</title>  
      </head>  
      <body>  
           <h1 align="center">Some Important Things for Data Type in PHP</h1>  
                <h2 align="left">Sample 1 : Which is Faster way to print?</h2>  
                     <?php  
                          echo "My General Name is Samee Ullah Feroz. <br />"; //It is simple form to print data  
                          echo 'My General Company Name is Getacho.' #it is faster way. because in this it just give print command.  
                      ?>  
                <h2 align="left">Sample 2 : Rules for Integers</h2>  
                     <?php  
                          echo "An integer must have at least one digit from 0 to 9. <br />";  
                          echo "An Integer cann't contain comma, space or blanks. <br />";  
                          echo "And Integer must have not a decimal point. <br />";  
                          echo "An Integer can be either positive or negative. <br />";  
                          echo "Integers can be specified in three formates:<br />";  
                          echo  
                               "<ol>  
                                    <li>Decimal (10-based)</li>  
                                    <li>Hexadecimal (16-based-prefixed with 0x)</li>  
                                    <li>Octal (8-based-prefixed with 0)</li>  
                               </ol>"  
                     ?>  
                <h2 align="left">Sample 3 : Var_dump variable usage</h2>  
                     <?php  
                          echo "var_dump is a variable to show the integer type, value and size. <br />";  
                          echo "var_dump also add a break line in output. <br />";  
                          echo "<b>var_dump Example:</b> <br />";  
                          echo  
                               $a=50;  
                               $b=100.50;  
                               $c="values";  
                               var_dump ($a, $b, $c);  
                     ?>  
                <h2 align="left">Sample 4 : Floating Points Numbers</h2>  
                     <?php   
                          $x = 10.365;  
                          var_dump($x);  
                          echo "<br />";   
                          $x = 2.4e3;  
                          var_dump($x);  
                          echo '<br />'; //I used single quote that you can remember its printing rule    
                          $x = 8E-5;  
                          var_dump($x);  
                     ?>  
      </body>  
 </html>   


0 comments

Static Variable And Its Usage In Function : 3rd Day Lecture of PHP


Static Variable And Its Usage

Sample 1 : What is Static Variable and How to use it?

Static variable is like local variable, but it locates its fake behavior to user.
And One More thing, Once it used, it finished.
Age behavior with every year:
Samee age update: 20
Samee age update: 21
Samee age update: 22



 <html>  
      <head>  
           <title>Static Variable And Its Usage In Function : 3rd Day Lecture of PHP</title>  
      </head>  
      <body>  
           <h1 align="center">Statis Variable And Its Usage</h1>  
                <h2 align="left">Sample 1 : What is Static Variable and How to use it?</h2>  
                     <?php echo "Static variable is like local variable, but it locates its fake behavior to user.<br />" ?>  
                     <?php echo "And One More thing, Once it used, it finished. <br />" ?>  
                     <?php  
                          echo "<p>Age behavior with every year:</p>";  
                               function age()  
                               {  
                               static $age = 20;  
                               echo "Samee age update: ". $age . "<br />"; //dot operator should be before and after variable.   
                               $age++;  
                               }  
                               age();  
                               age();  
                               age();  
                     ?>   
      </body>  
 </html>   

0 comments

Local Variable, Global Variable Use In Function : 3rd Day Lecture of PHP


Local Variable, Global Variable Use

Sample 1 : Simple Function of Local And Global Variable

This is Big Number: 35
This number is less than Big Number : 15

Sample 2 : Rules of Local And Global Variables

  1. We can not use Local Variables outside the function.
  2. We can not use Global Variables inside the function Directly.
  3. We can use Global Variables inside the function by $GLOBALS['Variable'].
    • But in $GLOBALS['Variable'], you can contain only one single variable.
    • For different Variables you will create separate $GLOBALS['x']
    • In $GLOBALS all spellings are Capital
    • Variable will be written within single quote.
  4. As you know; after function completion, local variables will be finished, so you need to keep in mind these rules

Sample 3 : Global Variable Use inside the Function.

What is Your Name And Age?
My Name is Samee
And My Age is 22 And my double age will be 44
Tell me your complete bio data?
My Name is Samee, age is 22, and My height is 5.3.

Sample 4 : Local Variable use Out Side the Function.

Sorry! We can not use Local Variable out side the Function in PHP.


   <html>
 <head>
  <title>Local and Global Variables Use In Function : 3rd Day Lecture of PHP</title>
 </head>
 <body>
  <h1 align="center">Local Variable, Global Variable Use</h1>
   <h2 align="left">Sample 1 : Simple Function of Local And Global Variable</h2>
    <?php 
     $a=5;
     $b=10;
     function add()
     {
     $c=15;
     $d=20;
     echo "This is Big Number: " . ($c+$d);
     echo "<br />";
     }
     add();
     
     echo "This number is less than Big Number : ". ($a+$b);
     
     echo "<br />";
    ?>
    
   <h2 align="left">Sample 2 : Rules of Local And Global Variables</h2>
    <?php
    echo 
     '<ol>
      <li>We can not use Local Variables outside the function.</li>
      <li>We can not use Global Variables inside the function Directly.</li>
      <li>We can use Global Variables inside the function by $GLOBALS[\'Variable\'].
       <ul>
       <li>But in $GLOBALS[\'Variable\'], you can contain only one single variable.</li>
       <li>For different Variables you will create separate $GLOBALS[\'x\']</li>
       <li>In $GLOBALS all spellings are Capital</li>
       <li>Variable will be written within single quote.</li>
       </ul></li>
      <li>As you know; after function completion, local variables will be finished, so you need to keep in mind these rules</li>
     </ol>' //backslash operator is used to give output of single quote of double quote in double quote. 
    ?>
    
     <h2 align="left">Sample 3 : Global Variable Use inside the Function.</h2>
    <?php
    $name="Samee";
    $age=22;
    $hight=5.3;
    function msr()
    {
     echo "<b>What is Your Name And Age?</b> <br />";
     echo "My Name is {$GLOBALS['name']}";
     echo "<br />";
     echo " And My Age is " . $GLOBALS['age'] . " And my double age will be " . ($GLOBALS['age']*2) . "<br />";
    }
    msr();
     echo "<b>Tell me your complete bio data?</b> <br />";
     echo "My Name is $name, age is $age, and My height is $height."
    ?>
    
   <h2 align="left">Sample 4 : Local Variable use Out Side the Function.</h2>
    <?php echo "<b>Sorry! We can not use Local Variable out side the Function in PHP.</b>" ?>
 </body>
</html>

0 comments

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>   



0 comments

Single Quote Concept in PHP : 3rd Day Lecture


Single ' ' Quote Concept in PHP

Sample 1 : Single Quote As Double Quote

My Name is Samee. And I am here to learn PHP.

My Name is Samee and my friends call me Sam.

Real Single Quotes Effact
My age is {$age}
My Short Name Is $name



   <html>  
     <head>  
       <title>Single Quote ' ' Concept in PHP : 3rd Day Lecture</title>  
     </head>  
     <body>  
       <h1 align="center">Single Quote Concept in PHP</h1>  
       <!--This Topis is also related to Display of Variables in PHP : 3rd Lecture of PHP -->  
            <h2 align="left">Sample 1 : Single Qoute As Double Qoute</h2>  
              <?php echo 'My Name is Samee. '.'And I am here to learn PHP. <br />' ?>  
           <?php echo '<p>My Name is Samee and my friends call me <b>Sam</b>. </p>' #you can use html also in single quote ?>  
           <?php echo '<b>Real Single Quotes Effact</b> <br />'?>  
                          <?php  
                          $age=22;  
                          echo 'My age is {$age} <br />' //As you can see in output that single quote does not support to variables.  
                          ?>  
           <?php  
                          $name = "Samee Ullah Feroz";  
                          echo 'My Short Name Is $name' //As you can see in output that single quote does not support to variables also without curly brackets.  
                          ?>  
     </body>  
   </html>  


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