Page 1 of 1

Look for "/" in a string

Posted: Sun Oct 10, 2004 1:51 pm
by mattmcb
I've been searching around on php.net trying to find a method for finding "/" in a string. Basically, the date needs to be formatted a certain way before it can be inserted in the database.

This is for a WAP site and I need to return and error if the string does not contain two "/". Can anyone help?

Posted: Sun Oct 10, 2004 1:57 pm
by qads
look into [php_man]strings[/php_man] functions.

Posted: Sun Oct 10, 2004 5:54 pm
by John Cartwright
[php_man]preg_match[/php_man]

Posted: Sun Oct 10, 2004 9:16 pm
by evilmonkey
[php_man]strstr[/php_man] This might also help, if you're looking for one character, I don't think full blown regex is the way to go as it really slows things down. Depends on what you need of course.

Posted: Mon Oct 11, 2004 3:47 am
by m3mn0n
I'd say [php_man]regex[/php_man] is a good solution.