<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.url.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.get-meta-tags.php',
    1 => 'get_meta_tags',
    2 => 'Extrait toutes les balises m&eacute;ta d\'un fichier HTML',
  ),
  'up' => 
  array (
    0 => 'ref.url.php',
    1 => 'Fonctions URL',
  ),
  'prev' => 
  array (
    0 => 'function.get-headers.php',
    1 => 'get_headers',
  ),
  'next' => 
  array (
    0 => 'function.http-build-query.php',
    1 => 'http_build_query',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/url/functions/get-meta-tags.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.get-meta-tags" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">get_meta_tags</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">get_meta_tags</span> &mdash; <span class="dc-title">Extrait toutes les balises méta d&#039;un fichier HTML</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.get-meta-tags-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>get_meta_tags</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$filename</code></span>, <span class="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$use_include_path</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong></span></span>): <span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>get_meta_tags()</strong></span> ouvre le fichier <code class="parameter">filename</code>
   et l&#039;analyse ligne par ligne à la recherche de balises
   <code class="literal">&quot;meta&quot;</code>. L&#039;analyse cesse lors de la rencontre de la balise
   <code class="literal">&lt;/head&gt;</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.get-meta-tags-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">filename</code></dt>
     <dd>
      <p class="para">
       Le chemin vers un fichier HTML, sous la forme d&#039;une <a href="language.types.string.php" class="link">chaîne de caractères</a>. Ce peut être
       un fichier local ou une <abbr title="Uniform Resource Locator">URL</abbr>.
      </p>
      <p class="para">
       <div class="example" id="example-1">
        <p><strong>Exemple #1 Ce que la fonction <span class="function"><strong>get_meta_tags()</strong></span> analyse</strong></p>
        <div class="example-contents">
<div class="htmlcode"><pre class="htmlcode">&lt;meta name=&quot;author&quot; content=&quot;name&quot;&gt;
&lt;meta name=&quot;keywords&quot; content=&quot;php documentation&quot;&gt;
&lt;meta name=&quot;DESCRIPTION&quot; content=&quot;a php manual&quot;&gt;
&lt;meta name=&quot;geo.position&quot; content=&quot;49.33;-86.59&quot;&gt;
&lt;/head&gt; &lt;!-- cesse l&#039;analyse ici --&gt;</pre>
</div>
        </div>

       </div>
      </p>
     </dd>
    
    
     <dt><code class="parameter">use_include_path</code></dt>
     <dd>
      <p class="para">
       Si le paramètre optionnel
       <code class="parameter">use_include_path</code> vaut <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>, 
       <span class="function"><strong>get_meta_tags()</strong></span> recherchera aussi le fichier
       dans l&#039;<a href="ini.core.php#ini.include-path" class="link">include_path</a>.
       Ce paramètre est utilisé pour des fichiers locaux, non des URLs.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.get-meta-tags-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne un tableau contenant toutes les balises méta analysées.
  </p>
  <p class="para">
   La valeur de la propriété sera utilisée comme clé du tableau,
   et sa valeur comme valeur correspondante de la clé. Il sera possible de
   ainsi passer en revue facilement ce tableau avec les fonctions
   de tableau standard. Les caractères spéciaux présents dans la
   valeur seront replacés par un souligné (<code class="literal">&quot;_&quot;</code>),
   et le reste est converti en minuscules. Si deux balises méta possèdent
   le même nom, seule la dernière sera retournée.
  </p>
  <p class="para">
   Retourne <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> en cas d&#039;échec.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.get-meta-tags-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-2">
    <p><strong>Exemple #2 Ce que la fonction <span class="function"><strong>get_meta_tags()</strong></span> retourne</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// Supposons que les balises ci-dessus sont disponibles sur example.com<br /></span><span style="color: #0000BB">$tags </span><span style="color: #007700">= </span><span style="color: #0000BB">get_meta_tags</span><span style="color: #007700">(</span><span style="color: #DD0000">'http://www.example.com/'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Notez que les clés sont en minuscule, et<br />// le . a été remplacé par _ dans la clé<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">$tags</span><span style="color: #007700">[</span><span style="color: #DD0000">'author'</span><span style="color: #007700">];       </span><span style="color: #FF8000">// nom<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">$tags</span><span style="color: #007700">[</span><span style="color: #DD0000">'keywords'</span><span style="color: #007700">];     </span><span style="color: #FF8000">// documentation php<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">$tags</span><span style="color: #007700">[</span><span style="color: #DD0000">'description'</span><span style="color: #007700">];  </span><span style="color: #FF8000">// un manuel PHP<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">$tags</span><span style="color: #007700">[</span><span style="color: #DD0000">'geo_position'</span><span style="color: #007700">]; </span><span style="color: #FF8000">// 49.33;-86.59<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>

 
 <div class="refsect1 notes" id="refsect1-function.get-meta-tags-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    Seules les balises méta avec un attribut name seront parsées.
    Les guillemets ne sont pas nécessaires.
   </p>
  </p></blockquote>
 </div>
 

 <div class="refsect1 seealso" id="refsect1-function.get-meta-tags-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.htmlentities.php" class="function" rel="rdfs-seeAlso">htmlentities()</a> - Convertit tous les caract&egrave;res &eacute;ligibles en entit&eacute;s HTML</span></li>
    <li><span class="function"><a href="function.urlencode.php" class="function" rel="rdfs-seeAlso">urlencode()</a> - Encode une cha&icirc;ne en URL</span></li>
   </ul>
  </p>
 </div>


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