Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Devuelve El Referer Limpio

DZone's Guide to

Devuelve El Referer Limpio

·
Free Resource
// Limpia y devuelve el REFERER


	function getReferer(){
		// limpia el referer 
		$ref = $_SERVER['HTTP_REFERER'];
		$web = str_replace(array('http://','www.'),'',$ref);
		$web = substr($web,0,strpos ($web, '/'));
		if(!empty($web)):
			// retorna el referer limpio
			return $web;
		else:
			// sin referer
			return 'jane.es';
		endif;
	}
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}