且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将 XML nodeValue 转换为 PHP/HTML 字符串

更新时间:2023-02-03 10:26:44

您遇到的问题是由于您的代码向结果链接添加了空格和加号.空格会自动编码为 %20.解决方案是将它们从代码中删除,如下所示:

The problem you are getting arises from the fact that your code adds spaces and a plus sign to the resulting link. And spaces are automatically encoded as %20. The solution would be to remove them from the code like this:

$hint=  "<a href='profile.php?user=" . 
         $z->item(0)->childNodes->item(0)->nodeValue .
         "&page=profile' >" .
         $y->item(0)->childNodes->item(0)->nodeValue . "</a><span> (profile)</span>";

需要在所有四次出现时进行此更改.

This change would need to be done in all four occurences.