ereg_replace question

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
vexxy
Forum Newbie
Posts: 1
Joined: Mon Apr 28, 2008 5:02 pm

ereg_replace question

Post by vexxy »

I have the following lines of code:

$title =ereg_replace("[^[:alnum:]]", " ", $_POST['title']);
$title = ereg_replace(" +",' ',$title);

Any inputed title will be shown, except for the special chars. My question is, how can I allow the following chars: ' and -

Tnx in advance.

p.s. i'm a newbie programmer :)
Post Reply