PHP 字符串中的尖括号
它让我痛苦了一段时间...
我是 php 的新手,我正在为价格比较网站编写一个解析器,因此我需要有相当多的变量:
$plae = "<pastwisko>";
$user = "<krowa>";
$product "<trawa>";
但是没有空格...
使用或回显这些变量给了我没有什么。我尝试搜索 stackoverflow、google 和 php 文档,但一无所获......也许我的英语很糟糕......
你我会非常感谢你的帮助
It keeps killing me for some time...
I'm new to php and I'm writing a parser for price comparison site, therefore I need to have quite a few variables:
$plae = "<pastwisko>";
$user = "<krowa>";
$product "<trawa>";
But without spaces...
Using or echoing those gives me nothing. I've tried to search stackoverflow, google and php documentation and nothing... maybe my english sucks...
Thou I'll be really greatfull for help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您将这些内容回显为 HTML,那么它们将被您的浏览器解析为[不正确] HTML 标记,并且不会显示。您应该使用
htmlentities
使它们显示为文本: http:// /php.net/manual/en/function.htmlentities.phpIf you are echoing those into HTML then they will be parsed as [incorrect] HTML tags by your browser and will not show. You should use
htmlentities
to make them display as text: http://php.net/manual/en/function.htmlentities.php你忘了一个“=”。
编辑:
乔对您的问题有正确的答案,我在终端中运行了脚本,这是我遇到的唯一错误。我没有想到
htmlentities
,如果我的帖子不相关且不必要,我很抱歉。You've forgot a "=".
Edit:
Joe has the correct answer to your problem, I ran the script in the terminal and that was the only error I was given. I didn't think of
htmlentities
, I'm sorry if my post was irrelevant and unnecessary.