Home > Backend Development > PHP Tutorial > strpos函数,该如何处理

strpos函数,该如何处理

WBOY
Release: 2016-06-13 11:45:15
Original
1120 people have browsed it

strpos函数

<input id="flagc" type ="checkbox" value="c" name="flags[]"<?php if(strpos($row['flag'],'c')=='tuue') echo "checked='checked'" ?>/>推荐[c]<br />			    <input id="flaga" type ="checkbox" value="a" name="flags[]"<?php if(strpos($row['flag'],'a')=='true') echo "checked='checked'" ?>/>特荐[a]<br />			    <input id="flagh" type ="checkbox" value="h" name="flags[]"<?php if(strpos($row['flag'],'h')=='true') echo "checked='checked'" ?>/>头条[h]<br />			    <input id="flago" type ="checkbox" value="o" name="flags[]"<?php if(strpos($row['flag'],'o')=='true') echo "checked='checked'" ?>/>特荐[o]<br />			    <input id="flagn" type ="checkbox" value="n" name="flags[]"<?php if(strpos($row['flag'],'n')=='true') echo "checked='checked'" ?>/>特荐[n]
Copy after login

我想判断$row['flag']是不是c,a,h,o,n其中的一个。加个对勾。这么写为什么只能判断推荐【c】那个啊?后面的都没有显示啊。既然第一个能成功后面的也应该对吧。

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