Here we will understand, How we can know the type of the variable. As PHP automatic set the type to the variable as we defined it, But sometime it is neccessary to check the type of the variable. Suppose you have a condition, that it there is more then 10 Items in store, you will add them all for calculation of the total payment, but when the item is only one, there is no need to adding them, as the total cost will be cost of the item. So you can do by checking the variable type of the variable m If it is array then we will add them all, if this is only a string or Integer, and it is the final cost. Example you have an Variable $value. if it is array, we will use array function to check as follow: <?php $totalcost = 0; if( is_array ($value) ) { ...