|
get_resource_type
Returns the resource type
(PHP 4 >= 4.0.2, PHP 5)
Example 2585. get_resource_type() example<?php Code Examples / Notes » get_resource_typejdhawk _at_ gmail
In PHP5 (on Linux), the above example identifies the "file" handler as a 'stream', not 'file'. This can be particularly worrisome if you're trying to determine the type of stream using this function. The alternative is to use <?php stream_get_meta_data() ?>, which returns an array containing "stream_type (string) - a label describing the underlying implementation of the stream." hessodreamy
Furthermore, this function returns 'stream' on php 4.3 on windows & linux. You if you want to differentiate between a file resource and other stream resources, as stated before stream_get_meta_data() gives you an array which, on my system, contains the following elements which might suggest a file handle: [wrapper_type] => plainfile [stream_type] => STDIO However I've only compared this to a stream from a url, so I include this only as a suggestion. |
Change Languagedebug_zval_dump doubleval empty floatval get_defined_vars get_resource_type gettype import_request_variables intval is_array is_binary is_bool is_buffer is_callable is_double is_float is_int is_integer is_long is_null is_numeric is_object is_real is_resource is_scalar is_string is_unicode isset print_r serialize settype strval unserialize unset var_dump var_export |