get_resource_id

(PHP 8)

get_resource_id Returns an integer identifier for the given resource

Açıklama

get_resource_id(resource $resource): int

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

Değiştirgeler

resource

The evaluated resource handle.

Dönen Değerler

The int identifier for the given resource.

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

Örnekler

Örnek 1 get_resource_id() example

<?php
$handle 
fopen('./storage/logs/lumen.log''rt');

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

echo 
get_resource_id($handle);

?>

Yukarıdaki örneğin çıktısı:

698

698

Ayrıca Bakınız

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top