<?php
bool is_scalar ( mix $var );
where,
$var = VARIABLE to test
?>
<?php
function isscalar($arg)
{
$type = is_scalar($arg);
{
if($type == TRUE)
// statement 1
{
var_dump($arg);
echo '<br>( is SCALAR )<br>';
}
else
// statement 2
{
var_dump($arg);
echo '<br>( is NOT SCALAR )<br>';
}
}
}
where,
$arg = ARGUMENT to test
?>
<?php
function isscalar($var)
{
$type = is_scalar($var);
{
if($type == TRUE)
// statement 1
{
var_dump($var);
echo '<br>( is SCALAR )<br><br>';
}
else
// statement 2
{
var_dump($var);
echo '<br>( is NOT SCALAR )<br><br>';
}
}
}
$var01a = $_SERVER['REMOTE_ADDR'];
$var01b = $_SERVER['HTTP_USER_AGENT'];
$var01c = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
$var01d = M_E;
$var01e = 1.6e-19;
$var01f = [ 'c' => 299792458, 'G' => 6.67428E-11 ];
$var01g = NULL;
$var01h = true;
isscalar($var01a);
isscalar($var01d);
isscalar($var01e);
isscalar($var01f);
isscalar($var01g);
isscalar($var01h);
?>