is_resource

Finds whether a variable is a resource

&reftitle.description; `bool` `is_resource` `mixed` `value`

Finds whether the given variable is a `resource`.

&reftitle.parameters;

`value`

- The variable being evaluated.

&reftitle.returnvalues;

Returns &true; if `value` is a `resource`, &false; otherwise.

&reftitle.examples;

### `is_resource` example

    <?php

    $handle = fopen("php://stdout", "w");
    if (is_resource($handle)) {
        echo '$handle is a resource';
    }

    ?>

&example.outputs;

    $handle is a resource

&reftitle.notes;

`is_resource` is not a strict type-checking method: it will return &false; if `value` is a resource variable that has been closed.

&reftitle.seealso;

- The resource-type documentation
- `get_resource_type`