Search This Blog

special data types in php

                                     resource data types and null data types




resource data types refers the external resources  like data connection , file pointer , FTP connection ...ect


<?php

mysql_connect("hostname",username","password");

?>

<?php

$con=mysql_connect("hostname",username","password");
echo $con;

?>

here con is external resource type

output :    resource #id2
                                                                  null data type



null is not a value

the variable not initialized with any  value
the variable initialized with null value
if the value of the variable is removed using unset function

based on by that 3 conditions we consider a variable has null value


<?php

$a=100;
unset($a);
echo is_null($a);

?>

output :  1

if is it null returns 1 else returns nothing




Share Links

Related Posts Plugin for WordPress, Blogger...