Heim  >  Artikel  >  Backend-Entwicklung  >  php判断字符串是否存在 php字符串检测代码

php判断字符串是否存在 php字符串检测代码

WBOY
WBOYOriginal
2016-07-25 09:11:50988Durchsuche

php判断字符串是否存

解决方法: 使用 === or !==

完整代码:

  1. if(stripos($sql, "insert") === 0){
  2. $excuteResult = mysql_query($sql);
  3. if($excuteResult){
  4. $sql = $sql2."where id = (select max(id) from subway2)";
  5. }
  6. } else if(stripos($sql, "delete") === 0 || stripos($sql, "update") === 0){
  7. if (strpos($foo, “my”)===0) { echo(‘I find!’);}
复制代码


Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn