On 08/11/2007, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Al wrote:
> > Delimiters needed. Can use about anything not already in your pattern.
> > "/" is very commonly used; but I like "#" or "%" generally; but, you
> > can't use "%" because your pattern has it.
> >
> > $html = preg_replace("#%ResID#",$bookid,$html);
>
> wont a str_replace() do just fine in this case?
>
> // and we can do backticks too ;-)
> $html = str_replace("%ResID", $bookid, `cat htmlfile`);
As Jochem said.
But don't use backticks, use file_get_contents(). It's portable and
you don't start up a new process just to read a file.
$html = str_replace('%ResID', $bookid, file_get_contents('htmlfile'));
-robin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php