Home >Backend Development >PHP Tutorial >PHP determines whether a string exists PHP string detection code

PHP determines whether a string exists PHP string detection code

WBOY
WBOYOriginal
2016-07-25 09:11:501053browse

php determines whether the string is stored

Solution: Use === or !==

Full code:

  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!');}
Copy code


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