Function To Remove Domain Name .com Extenstion At The End

Forums » PHP » Function To Remove Domain Name .com Extenstion At The End
This Page Contains information about Function To Remove Domain Name .com Extenstion At The End By wallpaperama in category PHP with 0 Replies. Last Upated: Thu May 15, 2014
oh, i have this neat php function you can use to remove the extention from a tld domain name.

for example, lets say i have a hostname as : wallpaperama.com

but i only want the wallaperama part and not the dot com part so this function will remove the extesion from the domain name:

hope this helps

function remove_ext($filename) {
	$extension = strrchr($filename, '.');
	if($extension !== false){
		$filename = substr($filename, 0, -strlen($extension));
	}
	return $filename;
}
Title: Function To Remove Domain Name .com Extenstion At The End [1263]
Tags: function to remove domain name extenstion at the end
By
Comments 0
Visits 313