<?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 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.get-meta-tags.php',
    1 => 'get_meta_tags',
    2 => 'Liest alle content-Attribute der Meta-Tags einer Datei aus und gibt ein
   Array zur&uuml;ck',
  ),
  'up' => 
  array (
    0 => 'ref.url.php',
    1 => 'URL Funktionen',
  ),
  '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' => 'de',
    '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">
   Liest alle content-Attribute der Meta-Tags einer Datei aus und gibt ein
   Array zurück
  </span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.get-meta-tags-description">
  <h3 class="title">Beschreibung</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">
   Öffnet <code class="parameter">filename</code> und untersucht die Datei Zeile für
   Zeile auf das Vorkommen von &lt;meta&gt;-Tags. Das Parsen wird bei
   <code class="literal">&lt;/head&gt;</code> beendet.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.get-meta-tags-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">filename</code></dt>
     <dd>
      <p class="para">
       Der Pfad zur HTML-Datei im Stringformat. Die Datei kann lokal oder als
       ein <abbr title="Uniform Resource Locator">URL</abbr> vorliegen.
      </p>
      <p class="para">
       <div class="example" id="example-1">
        <p><strong>Beispiel #1 Was <span class="function"><strong>get_meta_tags()</strong></span> parst</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;!-- das Parsen endet hier --&gt;</pre>
</div>
        </div>

       </div>
      </p>
     </dd>
    
    
     <dt><code class="parameter">use_include_path</code></dt>
     <dd>
      <p class="para">
       Ist <code class="parameter">use_include_path</code> auf <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> gesetzt,
       versucht PHP die Datei unter Verwendung der Standard-Include-Pfade aus
       der INI-Direktive <a href="ini.core.php#ini.include-path" class="link">include_path</a>
       zu finden. Diese Angabe wird nur für lokale Dateien, nicht jedoch für
       URLs verwendet.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.get-meta-tags-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt ein Array mit allen geparsten Meta-Tags zurück.
  </p>
  <p class="para">
   Dabei werden die Werte der name-Attribute zu den Schlüsseln des
   zurückgegebenen Arrays und die Werte der content-Attribute zu deren
   Werten, sodass einfach die Standard-Arrayfunktionen verwendet werden
   können, um das gesamte Array zu durchlaufen oder auf einzelne Werte davon
   zuzugreifen. Sonderzeichen im Wert des name-Attributs werden mit &#039;_&#039;
   ersetzt, alle anderen Zeichen werden in Kleinbuchstaben konvertiert. Haben
   zwei Meta-Tags den gleichen Namen, wird nur der letzte zurückgegeben.
  </p>
  <p class="para">
   Gibt im Fall eines Fehlers <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurück.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.get-meta-tags-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-2">
    <p><strong>Beispiel #2 Was <span class="function"><strong>get_meta_tags()</strong></span> zurückgibt</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">// Angenommen die genannten Tags stuenden auf www.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">// Beachten Sie, dass alle Keys kleingeschrieben werden<br />// und dass . im Schluessel durch _ ersetzt wird.<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">// name<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">// php documentation<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">// a php manual<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">Anmerkungen</h3>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <p class="para">
    Nur Meta-Tags mit name-Attributen werden geparst. Anführungszeichen sind
    nicht erforderlich.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.get-meta-tags-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.htmlentities.php" class="function" rel="rdfs-seeAlso">htmlentities()</a> - Wandelt alle geeigneten Zeichen in entsprechende HTML-Entities um</span></li>
    <li><span class="function"><a href="function.urlencode.php" class="function" rel="rdfs-seeAlso">urlencode()</a> - URL-kodiert einen String</span></li>
   </ul>
  </p>
 </div>


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