I'm fairly new to PHP so forgive me if this function is badly done.
I have a function:
function socialLink($sm_type = NULL) {
if ($sm_type = 'twitter') {
echo 'https://www.twitter.com';
} else {
echo 'https://www.facebook.com';
}
}
In my code when I call the function socialLink('facebook');
it echo's the Twitter URL.
Surely it should echo the Facebook URL since $sm_type
would be equal to 'facebook'
not twitter
?
Any help would be appreciated.