PHP字符串中的尖括号 [英] Angle brackets in PHP string

查看:40
本文介绍了PHP字符串中的尖括号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它一直在杀死我一段时间......

It keeps killing me for some time...

我是 php 新手,我正在为价格比较网站编写解析器,因此我需要有很多变量:

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>";

但没有空格...

使用或回应那些给我什么都没有.我试图搜索 stackoverflow、google 和 php 文档,但什么也没有……也许我的英语很烂……

Using or echoing those gives me nothing. I've tried to search stackoverflow, google and php documentation and nothing... maybe my english sucks...

你我会非常乐于助人

推荐答案

如果您将这些内容回显到 HTML 中,那么它们将被您的浏览器解析为 [不正确的] HTML 标签并且不会显示.您应该使用 htmlentities 使它们显示为文本:http://php.net/manual/en/function.htmlentities.php

If 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

这篇关于PHP字符串中的尖括号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆