Answers for "type variable php 7"

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

Browse Popular Code Answers by Language