JJohnsenDK Posted September 9, 2008 Share Posted September 9, 2008 Hey Im trying to check if a "(" char is in a string, but i get this error: Warning: preg_match() [function.preg-match]: No ending matching delimiter ')' found in C:\wamp\www\katrinelund\maincore.php on line 1218 What am i doing wrong? <?php if(preg_match("(", $str)){ do something }else do something else } ?> Quote Link to comment https://forums.phpfreaks.com/topic/123438-solved-how-do-i-check-if-a-quotquot-char-is-in-a-string/ Share on other sites More sharing options...
JonnoTheDev Posted September 9, 2008 Share Posted September 9, 2008 Only use regex when the standard string functions will not do the job so: if(strstr($str, "(")) { // do whatever } Quote Link to comment https://forums.phpfreaks.com/topic/123438-solved-how-do-i-check-if-a-quotquot-char-is-in-a-string/#findComment-637517 Share on other sites More sharing options...
JJohnsenDK Posted September 9, 2008 Author Share Posted September 9, 2008 thanks! Quote Link to comment https://forums.phpfreaks.com/topic/123438-solved-how-do-i-check-if-a-quotquot-char-is-in-a-string/#findComment-637531 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.