Re: [PHP] ereg_replace help

2004-03-18 Thread Chris Hayes
At 16:21 18-3-04, you wrote: I can do the reverse with: $output = ereg_replace('[[:alnum:]]', '', $string); Which will happily remove all alpha-numeric characters from $string! But I want it to remove anything but.. suggestions please? did you try $output = ereg_replace('[^[:alnum:]]', '', $st

Re: [PHP] ereg_replace help

2004-03-18 Thread John W. Holmes
From: "Richard Davey" <[EMAIL PROTECTED]> > I'm sure this is blindingly simple, but could anyone tell me how to > get an ereg_replace() to return a string where all characters OTHER > than alpha-numerics have been stripped out? $output = ereg_replace('[^a-zA-Z0-9]','',$string); The ^ is NOT (whe

RE: [PHP] ereg_replace help

2003-11-18 Thread Martin Towell
> * Thus wrote Martin Towell ([EMAIL PROTECTED]): > > Hi All, > > > > I have an array of strings in the following format: > > "abcd - rst" > > "abcd - uvw" > > "abcd - xyz" > > "foobar - rst" > > "blah - rst" > > "googol - uvw" > > > > What I want to do is strip everything

Re: [PHP] ereg_replace help

2003-11-18 Thread Curt Zirzow
* Thus wrote Martin Towell ([EMAIL PROTECTED]): > Hi All, > > I have an array of strings in the following format: > "abcd - rst" > "abcd - uvw" > "abcd - xyz" > "foobar - rst" > "blah - rst" > "googol - uvw" > > What I want to do is strip everything from the "

Re: [PHP] ereg_replace help

2003-11-18 Thread Robert Cummings
On Tue, 2003-11-18 at 02:30, Jason Wong wrote: > On Tuesday 18 November 2003 13:37, Martin Towell wrote: > > > I have an array of strings in the following format: > > "abcd - rst" > > "abcd - uvw" > > "abcd - xyz" > > "foobar - rst" > > "blah - rst" > > "googol - uvw" > > >

Re: [PHP] ereg_replace help

2003-11-18 Thread Henrik Hudson
On Monday 17 November 2003 23:37, Martin Towell <[EMAIL PROTECTED]> sent a missive stating: > Hi All, > > I have an array of strings in the following format: > "abcd - rst" > "abcd - uvw" > "abcd - xyz" > "foobar - rst" > "blah - rst" > "googol - uvw" > > What I

Re: [PHP] ereg_replace help

2003-11-18 Thread Jason Wong
On Tuesday 18 November 2003 13:37, Martin Towell wrote: > I have an array of strings in the following format: > "abcd - rst" > "abcd - uvw" > "abcd - xyz" > "foobar - rst" > "blah - rst" > "googol - uvw" > > What I want to do is strip everything from the " - " b

Re: [PHP] ereg_replace help

2003-11-18 Thread Eugene Lee
On Tue, Nov 18, 2003 at 04:37:52PM +1100, Martin Towell wrote: : : I have an array of strings in the following format: : "abcd - rst" : "abcd - uvw" : "abcd - xyz" : "foobar - rst" : "blah - rst" : "googol - uvw" : : What I want to do is strip everything from t

RE: [PHP] ereg_replace help

2002-02-04 Thread Lars Torben Wilson
- > From: John P. Donaldson [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 04, 2002 4:32 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] ereg_replace help > > > I'm not actually replacing \n with , I just used > that as an example. When I tried Martin's s

Re: [PHP] ereg_replace help

2002-02-03 Thread Jason Wong
On Monday 04 February 2002 13:31, John P. Donaldson wrote: > I'm not actually replacing \n with , I just used > that as an example. When I tried Martin's solution, I > got a parse error on this line: > > $content = implode($lines, "\n",); You've got a trailing comma. -- Jason Wong -> Gremlins

RE: [PHP] ereg_replace help

2002-02-03 Thread Martin Towell
y around Martin -Original Message- From: John P. Donaldson [mailto:[EMAIL PROTECTED]] Sent: Monday, February 04, 2002 4:32 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] ereg_replace help I'm not actually replacing \n with , I just used that as an example. When I tried Martin's solutio

Re: [PHP] ereg_replace help

2002-02-03 Thread John P. Donaldson
I'm not actually replacing \n with , I just used that as an example. When I tried Martin's solution, I got a parse error on this line: $content = implode($lines, "\n",); I checked the manual and it's constructed properly .. I think. What could be giving me the parse error on this line. T

Re: [PHP] ereg_replace help

2002-02-03 Thread Mike Frazer
nl2br() would serve that purpose as well. See the Strings section of the Functions Reference in the manual. Mike Frazer "Martin Towell" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > $lines = file("filename_here.blah"); // read in file as an array > $cont

RE: [PHP] ereg_replace help

2002-02-03 Thread Martin Towell
$lines = file("filename_here.blah"); // read in file as an array $content = implode("\n", $lines); // join it all back together $new_cont = ereg_replace("from", "to", $content); fopen(...); fputs(..., $new_content); fclose(...); if your intent is to replace all new lines with 's then use

Re: [PHP] ereg_replace: Help!

2001-04-23 Thread Plutarck
This works: $str = ''; echo eregi_replace("", "Replaced", $str); -- Plutarck Should be working on something... ...but forgot what it was. "Erica Douglass" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I have one ereg_replace problem that I cannot seem t