Question : PHP: Zap everything after &

Using PHP, what is the best way to zap everything after &
?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
<?php

$d=array();
$d['referrer']='http://www.google.com/search?q=Hello World&l=en&sp=1';

if(!empty($d['referrer'])) {
 if(strrpos($d['referrer'],'q=') > 0) {
 echo 'Search Term: <strong>' . substr($d['referrer'], 2+strrpos($d['referrer'],'q=')) . '</strong>';
 }
}

?>

Answer : PHP: Zap everything after &

Hi,

The issue is caused by the WebService Directory.

- As you said "our internal domain name is an actual domain name that we do not own". This is causing the issue.

- Refer this article: http://support.microsoft.com/kb/940726 and point the URL to proper URL.

Hope this helps,
Shree
Random Solutions  
 
programming4us programming4us