Variables


Variables can have more than one(1) data type at a time.    Data type conversion is auto and there's no conversion function(s) needed for the said process.


  $name = 'xyz';

  $tail = "www";


The above sample are both of STRING data type and will have the same result.   single quote or double quote have the same effect in PHP.



Concatenate


  $rest = $name . ' '. $tail;



String Function


  $num = strlen($name);


  • returns the string size

Numbers


  $num2 = 3.1456;    // standard float

  $num2 = round($num, 3);   // 3.0

  $num3 = round($num);   // 3.145



Sample code


  If (empty($_POST['name'])){

    $nn = FALSE;

  } else {

    $nn = $_POST['name'];

  }