php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #999 GET_META_TAGS returns an array which is not traversible by the EACH function
Submitted: 1998-12-21 00:26 UTC Modified: 1998-12-22 13:22 UTC
From: ccjust at prentice dot uq dot edu dot au Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.5 OS: Win32
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ccjust at prentice dot uq dot edu dot au
New email:
PHP Version: OS:

 

 [1998-12-21 00:26 UTC] ccjust at prentice dot uq dot edu dot au
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
---------------------

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-12-22 13:22 UTC] sas
This is fixed in 3.0.6
 [2013-07-18 07:55 UTC] adasdfdsd at ahoo dot com
das
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat May 03 06:01:27 2025 UTC