Php variables

Sujitha

 Variables in php

         In php, a variable is a containers that holds a value. You can declare a variable usingthe dollar sign($) followed by the variable name like this.

         $variable_name;

       You can also assign a value to the variable at the time od declaration or later in the code.
 
         $age=19;// Delacration and assignment at the same time
         $name;  // Delaration without assignment.
         $name="santhosh";// Assignment after delcation.

       Variavles in php are loosely typed, meaning you don't needto specify the data type explicitly. The data type is determined based on the value assigned to the variable.
      For example,a variable can hold integers,string, arrayor other data types.

        $number=30;//Interger 
        $name="santhosh";// String 
        $color["red","blue", "yellow"];// Array
        $is_active=true;// Boolean

       You can use variables in php to store and manipulate data throughout  your script.
Our website uses cookies to enhance your experience. Learn More
Accept !

GocourseAI

close
send