| 
	
 | 
 Posted by Kevin Wells on 02/08/07 17:28 
message <RMednRMe2_RoRFfYnZ2dnUVZ_smonZ2d@comcast.com> 
          "deko" <deko@nospam.com> wrote: 
 
>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); 
> 
 
Why not use str_replace: 
 
$refhost = str_replace('&','&', $refhost); 
 
[snip] 
 
 
--  
Kev Wells  http://kevsoft.topcities.com 
http://kevsoft.co.uk/ 
ICQ 238580561 
Shine forth upon our clouded hills?
 
  
Navigation:
[Reply to this message] 
 |