note 106868 deleted from function.is-resource by danbrown
| From: | danbrown@php.net | Date: | Tue, 03 Jan 2012 22:13:31 +0000 |
| Subject: | note 106868 deleted from function.is-resource by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-185338@lists.php.net to get a copy of this message | ||
Note Submitter: geompse at gmail dot com
----
Same problem with a GD image resource.
=> is_resource($gd) returns false
My workaround without any @ or try{}catch{} :
<?php
function isResource($var)
{
if(!empty($var) && !is_object($var) && substr((string)$var,0,13) ==
'Resource id #')
return (string)$var;
}
?>