|
Posted by Tim Van Wassenhove on 07/22/05 05:27
On 2005-07-21, Randell D. <support@fiprojects.moc> wrote:
> I'm using PHP 4.x and would basically like to replace whatever is not
> named above with an empty character (thus if a bang or question mark was
> in a string, it would be removed from the string).
>
> I know I could use something like preg_replace, but I don't know how to
> say "when not found"... In sed, I could do something like
>
> sed -e -i 's/[a-z]|[0-9]|_//g'
>
preg_replace("#[^a-z0-9_]#", "", $subject);
--
Met vriendelijke groeten,
Tim Van Wassenhove <http://timvw.madoka.be>
Navigation:
[Reply to this message]
|