Page 1 of 1

how to find special characters

Posted: Fri Dec 26, 2008 2:53 am
by mit
how can i fond ',' character in 13,14 ?

i am looking for the way to find the ',' charter and give alert to user.
can any one help?

Re: how to find special characters

Posted: Fri Dec 26, 2008 3:04 am
by requinix
Are you looking for a comma, or something that isn't a digit?

Code: Select all

if (strpos($string, ",") !== false) {
    // has a comma
}
 
if (!ctype_digit($string)) {
    // has something that's not a number
}