If string contains forward slash

前端 未结 3 539
一个人的身影
一个人的身影 2021-01-04 07:43

How do i make a if statement which checks if the string contains a forward slash?

$string = \"Test/Test\";   
if($string .......)
{
    mysql_query(\"\"); 
}         


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-04 08:27

    Use strpos()

    If it doesn't return false, the character was matched.

提交回复
热议问题