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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?
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