Re: interesting preg_replace problem
| From: | Rex A. Roof | Date: | Wed, 11 Oct 2000 13:00:19 +0000 |
| Subject: | Re: interesting preg_replace problem | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-19588@lists.php.net to get a copy of this message | ||
On Wed, Oct 11, 2000 at 01:00:43AM -0400, Daniel Convissor wrote:
> Dude:
>
> > the problem here is that it's replacing the {exec} with a hyperlinked {`Ch},
>
> Your program worked fine on my system (PHP 4.0.2, Win NT, Apache). The
> {exec} was replaced properly. I even threw in some more {} stuff to test it
> out. No problems.
okay, maybe theres something more about php I don't understand then,
I'm running 4.0b3 (I should probably upgrade), and how I got that data that
I e-mailed, I did this:
<? echo $test ?>
<? echo def_parse($test) ?>
<?
function def_parse ($string) {
return preg_replace('/\{([^}]+)}/e',
"'{<a href=view_entry.php?word='.
urlencode(trim('\\1'))
.'>\\1</a>}'",
$string);
}
?>
I suppose I'll try upgrading, and see what happens.
-Rex