Social Link Checker

This function checks a link or string and returns what social site it belongs to

It could be refined of course but it works for now

<?
function which_social_link($link_to_check) { //435PM

	$pos      = strripos($link_to_check, "Facebook");
	
	if ($pos !== false) { $this_link_is = "Facebook"; }
	
	$pos      = strripos($link_to_check, "twitter");
	
	if ($pos !== false) { $this_link_is = "Twitter"; }
	
	$pos      = strripos($link_to_check, "linkedin");
	
	if ($pos !== false) { $this_link_is = "Linkedin"; }
	
	if (empty($this_link_is)) { $this_link_is = "Personal Website"; }
	
	return $this_link_is;

} //435PM ?>
Comments