PHP.nl

get_resource_id

get_resource_id

Returns an integer identifier for the given resource

int **get_resource_id** resource $resource

This function provides a type-safe way for generating the integer identifier for a resource.

resourceThe evaluated resource handle.

The identifier for the given . int``resource

This function is essentially an cast of to make it easier to retrieve the resource ID. int``resource

Voorbeeld: produces the same result as an cast

<?php
$handle = fopen("php://stdout", "w");

echo (int) $handle . "\n";

echo get_resource_id($handle);

?>
698
698

get_resource_type