Wallpapers Forums Login

Function To Remove Domain Name Extenstion At The End

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;
}

Related Content

Information

Share

wallpaperama | Wallpapers | Forums | Terms Of Service

copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5