Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199903

[PHP3] Strip chars from string From: Adam Trachtenberg (adam <email protected>)
Date: 03/25/99

On Thu, 25 Mar 1999, CIMPOESU Teodor wrote:

> > The following doesn't seem to work :
> >
> > $stripped = ereg_replace("@$#^&*()", "'", $input);
> >
> most of those chars are special for a regex.You must escape them:
> ereg_replace("[@ | \$ | # | \^| \& | \* | \( | \)]+","",$input)

$stripped = ereg_replace("[@$#^&*()]", "", $input);

Will be fine.

-adam

-- 
/ adam maccabee trachtenberg | visit college life online \
\ adam <email protected>           | http://www.student.com    /

-- PHP 3 Mailing List http://www.php.net/ To unsubscribe send an empty message to php3-unsubscribe <email protected> To subscribe to the digest list: php3-digest-subscribe <email protected> For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3 List administrator: zeev-list-admin <email protected>