Re: preg_replace question
| From: | Phil Roberts | Date: | Sun, 23 Feb 2003 12:15:35 +0000 |
| Subject: | Re: preg_replace question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-136717@lists.php.net to get a copy of this message | ||
daniel@electroteque.org (Electroteque) wrote in
news:20021223103616.67980.qmail@pb1.pair.com:
> yet another regex question how could i hange the value within the
> quotes with preg_replace
>
> php_value upload_max_filesize "5M"
>
>
$str = preg_replace("#php_value
upload_max_filesize\s?['\"](.+?)[\"']#i",
"php_value upload_max_filesize\"\\1\"", $str);
Should work.