definition and Usage:
get_meta_tags-extracts all meta tags from a file content property, returns an array
Grammar:
Copy the Code code as follows: Array get_meta_tags (string filename, int [use_include_path]);
#打开 filename to parse the label in the file by line . The parsing work will stop at the point.
Parameters |
Describe |
FileName |
Path string for HTML file This parameter can be a local file or it can be a URL. Example #1 Get_meta_tags () resolved what (Note that the carriage return line-PHP uses a local function to parse the input, so the files on the MAC will not work on Unix). |
Use_include_path |
Setting Use_include_path to TRUE will cause PHP to attempt to open the file with each point in the Include_path standard include path. This is used only for local files and not for URLs. |
return value
Returns an array that contains all parsed meta tags.
The returned associative array takes the value of the property name as the key, the value of the properties content as the value, so you can easily traverse this associative array or access a value using a standard array function. The special characters in the property name are replaced with ' _ ', while the other characters are converted to lowercase. If there are two meta tags with the same name, only the last one that appears is returned.
Example
Copy the Code code as follows:
Assuming that the top label is in Www.jb51.net
$tags = get_meta_tags (' http://www.jb51.net ');
Note that all keys (key) are lowercase, and the key is '. ' is converted into ' _ '.
echo $tags [' author ']; DXY | Www.jb51.net
echo $tags [' keywords ']; Script, VBScript, regular expression, jquery,dos,bat, batch, javascript,photoshop,html,div+css,asp,php,asp.net
echo $tags [' description ']; Script Home is a professional website construction resources, scripting Learning Web site, providing ASP, PHP, ASP, JavaScript, jquery, VBScript, DOS batch processing, web production, network programming, website construction and other programming materials.
Special Instructions
Only meta tags that contain the name attribute will be parsed.
http://www.bkjia.com/PHPjc/769244.html www.bkjia.com true http://www.bkjia.com/PHPjc/769244.html techarticle definition and Usage: get_meta_tags-extracts all meta tag content properties from a file, returning an array syntax: Copy the code as follows: Array get_meta_tags (string f ...