Answers for "how to define variable type in php"

PHP
1

php what type of variable is it

echo gettype($var1)."\n"; 
echo gettype($var2)."\n"; 
echo gettype($var3)."\n";
Posted by: Guest on March-09-2021
0

php define variable type

<?php
$foo = "5bar"; // string
$bar = true;   // boolean

settype($foo, "integer"); // $foo is 5   (integer)
settype($bar, "string");  // $bar is "1" (string)
?>
Posted by: Guest on April-07-2021

Code answers related to "how to define variable type in php"

Browse Popular Code Answers by Language