philip Sat Jan 18 01:07:02 2003 EDT Added files: /phpdoc/en/reference/url get-meta-tags.xml Log: This is the best place for this function and closes bug #19208
Index: phpdoc/en/reference/url/get-meta-tags.xml +++ phpdoc/en/reference/url/get-meta-tags.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 --> <refentry id="function.get-meta-tags"> <refnamediv> <refname>get_meta_tags</refname> <refpurpose> Extracts all meta tag content attributes from a file and returns an array </refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>array</type><methodname>get_meta_tags</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>use_include_path</parameter></methodparam> </methodsynopsis> <para> Opens <parameter>filename</parameter> and parses it line by line for <meta> tags of the form <example> <title>Meta Tags Example</title> <programlisting role="html"> <![CDATA[ <meta name="author" content="name"> <meta name="tags" content="php3 documentation"> </head> <!-- parsing stops here --> ]]> </programlisting> </example> (pay attention to line endings - PHP uses a native function to parse the input, so a Mac file won't work on Unix). </para> <para> The value of the name property becomes the key, the value of the content property becomes the value of the returned array, so you can easily use standard array functions to traverse it or access single values. Special characters in the value of the name property are substituted with '_', the rest is converted to lower case. </para> <para> Setting <parameter>use_include_path</parameter> to 1 will result in PHP trying to open the file along the standard include path. </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> -- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php