I’m guessing this has been asked already. I know in php you can change the datatype of a variable as in this example.
$var = '3';
if (is_string($var))
echo "variable is now string <br />";
$var = $var+1;
if (is_int($var))
echo "variable is now integer <br />";
However can a variable hold more than one data type at a single point in time?
If you add var_dump like this in your code:
Your output will be:
Which indicates a simple rule that PHP lets you use a variable in whatever way you like and changes the data type it repsents as you use in your code.