note 44733 added to function.explode
| From: | jakeAT4bnormalDOTcom at osu1 dot php dot net | Date: | Sat, 14 Aug 2004 20:32:08 +0000 |
| Subject: | note 44733 added to function.explode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-74647@lists.php.net to get a copy of this message | ||
I find this function incredibly useful. I used to create a function called iReferrer(). What
iReferrer() does is display an 'Intelligent Referrer'.
This is my code:
<?php
//function_defs.php
function iReferrer(){
$split = explode(".", $_SERVER['HTTP_REFERRER']);
echo $split[1];
}
?>
<?php
//other_page.php
include("function_defs.php");
// other content
iReferrer()
?>
If the HTTP_REFERRER was 'http://www.google.com',
iReferrer() would display The word 'google' as it splits the referrer using the
'dots' from the URL.
----
Manual Page -- http://www.php.net/manual/en/function.explode.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44733
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44733&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44733&report=yes
Search -- http://master.php.net/manage/user-notes.php