Bug #999 Updated: GET_META_TAGS returns an array which is not traversible by the EACH function
| From: | Bug Database | Date: | Mon, 21 Dec 1998 05:43:18 +0000 |
| Subject: | Bug #999 Updated: GET_META_TAGS returns an array which is not traversible by the EACH function | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-2950@lists.php.net to get a copy of this message | ||
ID: 999
User Update by: ccjust@prentice.uq.edu.au
Status: Open
Bug Type: Misbehaving function
Description: GET_META_TAGS returns an array which is not traversible by the EACH function
The returned array from a get_meta_tags call seems be doubled up.
A count on the array is double the amount of metatags.
I'm not too certain if it's a feature or a bug.
The HTML File being parsed contains
-----------------
<meta name="dc.title" content="The University of Queensland Home Page1">
<meta name="DC.date.issued" content="1998-12-15">
<meta name="DC.date.modified" content="1998-12-15">
<meta name="DC.type" content="document">
<meta name="DC.format" content="text/html">
<meta name="DC.identifier" content="http://www.uq.edu.au/">
<meta name="UQ.function" content="">
<meta name="UQ.recordtype" content="Home">
-----------------
The script processing the above file
-----------------
$test = get_meta_tags($url);
$num = Count($test);
$i=0;
echo "The Array contains $num Entries<BR><BR>";
ksort($test);
while ($results = each($test)){
echo $i.":".$results["key"]." --
".$results["value"]."<BR>";
$i++;
}
------------------
The Resulting output
------------------
The Array contains 16 Entries
0:0 -- The University of Queensland Home Page1
1:1 -- 1998-12-15
2:2 -- 1998-12-15
3:3 -- document
4:4 -- text/html
5:5 -- http://www.uq.edu.au/
6:6 --
7:7 -- Home
8:dc_date_issued -- 1998-12-15
9:dc_date_modified -- 1998-12-15
10:dc_format -- text/html
11:dc_identifier -- http://www.uq.edu.au/
12:dc_title -- The University of Queensland Home Page1
13:dc_type -- document
14:uq_function --
15:uq_recordtype -- Home
---------------------
Full Bug description available at: http://ca.php.net/bugs.php3?id=999
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net