<?php
bool is_resource ( mix $value );
where,
$value = Variable to test
?>
<?php
$f1 = 'test';
$opts1 = [ 'http' => [ 'method'=>"POST",
'header' => "Accept-language: en",
'content' => $f1 ] ];
$test1 = is_resource($opts1);
if ($test1 == true)
{
var_dump($opts1) . '<br><br>';
echo "IS a RESOURCE<br><br>";
}
else
{
var_dump($opts1) . '<br><br>';
echo "<br><br>IS NOT a RESOURCE<br><br>";
}
?>
<?php
$var02c = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
$var02d = M_E;
$var02e = 1.6e-19;
$var02f = [ 'c' => 299792458, 'G' => 6.67428E-11 ];
$var02g = NULL;
$var02h = imagecreate( 100, 100 );
function ISresource($var)
{
if(is_resource($var))
{
var_dump($var);
echo '<br>is a RESOURCE<br><br>';
@fclose($var);
}
else
{
var_dump($var);
echo '<br>is NOT a RESOURCE<br><br>';
}
}
ISresource($var02c);
ISresource($var02d);
ISresource($var02g);
ISresource($var02h);
?>