squiblo Posted July 11, 2010 Share Posted July 11, 2010 $sting = "bo'''''''b"; if ($string has more than one ') echo "you have more than one '"; How can this be done? Quote Link to comment https://forums.phpfreaks.com/topic/207419-check-string-for-more-than-one/ Share on other sites More sharing options...
wildteen88 Posted July 11, 2010 Share Posted July 11, 2010 You could use substr_count $count = substr_count($text, '\''); if($count > 1) echo "you have more than one '"; Quote Link to comment https://forums.phpfreaks.com/topic/207419-check-string-for-more-than-one/#findComment-1084413 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.