how to find special characters

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mit
Forum Commoner
Posts: 32
Joined: Mon Sep 15, 2008 6:37 am

how to find special characters

Post 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?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: how to find special characters

Post 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
}
Post Reply