Home  >  Article  >  Backend Development  >  PHP如何比较变量的大小

PHP如何比较变量的大小

WBOY
WBOYOriginal
2016-06-23 13:56:141510browse

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


回复讨论(解决方案)

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

没看明白,大神

哦,明白了,多谢

Statement:
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