php3-list | 199903
Date: 03/25/99
- Next message: Adam Trachtenberg: "[PHP3] Strip chars from string"
- Previous message: Colin Viebrock: "RE: [PHP3] Attempting to use serialize() and unserialize() for passing an array from page to page"
- In reply to: PT Dekker: "[PHP3] ...no subject..."
- Next in thread: Adam Trachtenberg: "[PHP3] Strip chars from string"
- Reply: Adam Trachtenberg: "[PHP3] Strip chars from string"
- Reply: Dan Delaney: "Re: [PHP3] ...no subject..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
PT Dekker wrote:
> Dear ...
>
> I want to strip off some characters from a string
> The following doesn't seem to work :
>
> $stripped = ereg_replace("@$#^&*()", "'", $input);
>
> are there other ways to do this ?
>
most of those chars are special for a regex.You must escape them:
ereg_replace("[@ | \$ | # | \^| \& | \* | \( | \)]+","",$input)
I think it *should* work.
CIMPOESU Teodor, Web Programmer
@ DIGICOM S.A. Bucharest, Romania
@ Internet, site development
@ teo <email protected>,+(401)-330.47.28
official home page: http://www.digiro.net/
-- 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>
- Next message: Adam Trachtenberg: "[PHP3] Strip chars from string"
- Previous message: Colin Viebrock: "RE: [PHP3] Attempting to use serialize() and unserialize() for passing an array from page to page"
- In reply to: PT Dekker: "[PHP3] ...no subject..."
- Next in thread: Adam Trachtenberg: "[PHP3] Strip chars from string"
- Reply: Adam Trachtenberg: "[PHP3] Strip chars from string"
- Reply: Dan Delaney: "Re: [PHP3] ...no subject..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

