RE: ereg_replace help wanted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 29 Sep 2004 George Pitcher wrote:

> In short I'm looking to search for any character that is NOT one of the
> following:
> 
> "0-9 cdilmvx ," and replace it with '-' [chr(45)] (I do an initial strip of
> spaces at the beginning of the process).

Try something like:

	$newstring = preg_replace('/[^cdilmvx0-9,]/', '-', $string);

But do you really want an "A" (etc.) to be considered a dash?

--
Tom

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux