get_meta_tags geht nicht richtig

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • get_meta_tags geht nicht richtig

    PHP-Code:
    $content_string implode("\n"$content);
    $array_meta_tags get_meta_tags($content_string);
    echo(
    "<br><br> keywords: $array_meta_tags[Keywords]"); 
    Hallo!

    Ich habe ein Problem mit der Funktion get_meta_tags.
    Im obigen Beispiel ist $content der Quellcode einer
    Webseite welche in einem array gespeichert ist. Mit
    implode(); wird sie in $content_string gespeichert (als string).
    Dann wende ich auf den string die funktion get_meta_tags an
    und versuche die keywords auszugeben.

    Es kommt keine Fehlermeldung und keine keywords.
    Aber in $content_string sind Meta Tags (keywords) drin.

    HILFE


    gruss

  • #2
    Re: get_meta_tags geht nicht richtig

    ist dieser zugriff hier
    $array_meta_tags[Keywords]
    denn richtig?

    also hast du auch wirklich einen meta-tag mit description 'Keywords' in der seite, oder liegt es evtl. an sowas simplem wie fehlerhafter gross-/ kleinschreibung?


    lass dir doch zur kontrolle mal das gesamte array mit print_r ausgeben:

    print_r($array_meta_tags);
    I don't believe in rebirth. Actually, I never did in my whole lives.

    Kommentar


    • #3
      So nicht,
      get_meta_tags() benötigt einen FILE zum Parsen

      get_meta_tags ( string filename)

      und schau Dir mal die die 'User Contributed Notes' bei http://www.php.net/manual/de/function.get-meta-tags.php an :

      >> An Important Note about META tags and this function : if your META tag contains newline "\n" characters, get_meta_tags() will return a NULL value for that name property. Removing the newlines from the source META tag corrects the problem.


      Gruß
      Henry

      Kommentar

      Lädt...
      X