note 36146 added to ref.xml
| From: | windix at 263 dot net | Date: | Sun, 28 Sep 2003 16:01:13 +0000 |
| Subject: | note 36146 added to ref.xml | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-57215@lists.php.net to get a copy of this message | ||
I found a little bug in the example 2 on this page - "XML Tag Mapping Example" (it's
example's bug, not PHP's bug :) )
The author use "if ($htmltag = $map_array[$name])". Pay attention to the equal char, it is
single, not double, so it means math operation, but not logical comparing operation.
This idea is very ingenurity, but sometimes may cause a wrong result.
if I add an element: "ZERO"=>"0" to the arrays "map_array", (of
cause I know <0> is not a valid html tag, it's just a example here,) when I parse the
<ZERO> tag, I should got the "html tag" <0>, but I got nothing, because the
result "0" here equals FALSE in logicals.
any questions to http://www.douzi.org
----
Manual Page -- http://www.php.net/manual/en/ref.xml.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+36146
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+36146&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+36146&report=yes