|
Posted by Petr Vileta on 02/08/07 12:53
"deko" <deko@nospam.com> píse v diskusním príspevku
news:RMednRMe2_RoRFfYnZ2dnUVZ_smonZ2d@comcast.com...
>I need to capture referrers to a website and populate a page with links to
>the referring pages.
>
> How do I use preg_replace to search for and replace all ampersands ('&')
> with the corresponding HTML special character ('&')?
>
> $refurl = trim(getenv("HTTP_REFERER"));
> $refhost = parse_url($refurl);
> $refhost = preg_replace("\&\", "\&\", $refhost);
>
$refhost = preg_replace('/\&/', '\&\;', $refhost);
Note - I use single quotes.
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
Navigation:
[Reply to this message]
|