Re: reg. expressions

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

 



> on one place I have string "something (something_2)"
> I have to take out of the string everything in brackets and brackets as
> well.
> probably I will need to use Regular Expression Functions but I'm really
> bad with them :)

$string = "something (something_2)";
$pattern = "/\(.*\)/";
$replacement = "";
echo preg_replace($pattern, $replacement, $string);

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux