<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.info.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.get-resources.php',
    1 => 'get_resources',
    2 => 'Returns active resources',
  ),
  'up' => 
  array (
    0 => 'ref.info.php',
    1 => 'PHP Options/Info Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.get-required-files.php',
    1 => 'get_required_files',
  ),
  'next' => 
  array (
    0 => 'function.getenv.php',
    1 => 'getenv',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/info/functions/get-resources.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.get-resources" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">get_resources</h1>
  <p class="verinfo">(PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">get_resources</span> &mdash; <span class="dc-title">Returns active resources</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.get-resources-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>get_resources</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$type</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>

  <p class="para rdfs-comment">
   Returns an array of all currently active <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>s, optionally
   filtered by resource type.
  </p>
  <blockquote class="note"><p><strong class="note">Nota</strong>: 
   <span class="simpara">
    This function is meant for debugging and testing purposes. It is not supposed
    to be used in production environments, especially not to access or even manipulate
    resources which are normally not accessible (e.g. the underlying stream resource
    of <span class="classname"><a href="class.splfileobject.php" class="classname">SplFileObject</a></span> instances).
   </span>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.get-resources-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">type</code></dt>
     <dd>
      <p class="para">
       If defined, this will cause <span class="function"><strong>get_resources()</strong></span> to only
       return resources of the given type.
       <a href="resource.php" class="link">A list of resource types is available.</a>
      </p>
      <p class="para">
       If the <span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="literal">Unknown</code> is provided as
       the type, then only resources that are of an unknown type will be
       returned.
      </p>
      <p class="para">
       If omitted, all resources will be returned.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.get-resources-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   Returns an <span class="type"><a href="language.types.array.php" class="type array">array</a></span> of currently active resources, indexed by
   resource number.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.get-resources-changelog">
  <h3 class="title">Log delle modifiche</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Versione</th>
      <th>Descrizione</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">type</code> is nullable now.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.get-resources-examples">
  <h3 class="title">Esempi</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 Unfiltered <span class="function"><strong>get_resources()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$fp </span><span style="color: #007700">= </span><span style="color: #0000BB">tmpfile</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">get_resources</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Il precedente esempio visualizzerà
qualcosa simile a:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">array(1) {
  [1]=&gt;
  resource(1) of type (stream)
}</pre>
</div>
    </div>
   </div>
   <div class="example" id="example-2">
    <p><strong>Example #2 Filtered <span class="function"><strong>get_resources()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$fp </span><span style="color: #007700">= </span><span style="color: #0000BB">tmpfile</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">get_resources</span><span style="color: #007700">(</span><span style="color: #DD0000">'stream'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">get_resources</span><span style="color: #007700">(</span><span style="color: #DD0000">'curl'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Il precedente esempio visualizzerà
qualcosa simile a:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">array(1) {
  [1]=&gt;
  resource(1) of type (stream)
}
array(0) {
}</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.get-resources-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.get-loaded-extensions.php" class="function" rel="rdfs-seeAlso">get_loaded_extensions()</a> - Restituisce una matrice con il nome di tutti i moduli compilati
     e caricati</span></li>
    <li><span class="function"><a href="function.get-defined-constants.php" class="function" rel="rdfs-seeAlso">get_defined_constants()</a> - Restituisve un array associativo con i nomi di tutte le costanti
     ed i loro valori</span></li>
    <li><span class="function"><a href="function.get-defined-functions.php" class="function" rel="rdfs-seeAlso">get_defined_functions()</a> - Returns an array of all defined functions</span></li>
    <li><span class="function"><a href="function.get-defined-vars.php" class="function" rel="rdfs-seeAlso">get_defined_vars()</a> - Restituisce un'array contenente tutte le variabili definite</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>