PHP怎么比较变量的大小

WBOY
Release: 2016-06-13 11:58:30
Original
1574 people have browsed it

PHP如何比较变量的大小
php前段通过row获取到A字段的值
$A=$row['A'] ;
想要将$A和“无”这个字做比较,相等的话就显示“无”为红色。请问一下比较这里该怎么写呢。

------解决方案--------------------

$s = '想要将$A和“无”这个字做比较,相等的话就显示“无”为红色。请问一下比较这里该怎么写呢';<br />$A = '无';<br />echo preg_replace("/$A/", '<span style="color:#f00">$0</span>', $s);<br />
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!