Im trying to call a script if the browser is firefox and its working. But now i want to do the same if the browser is Safari and im not being able to figure it out im missing the way that php works in if statments , im new to php.
<?php
function get_browser_name($user_agent)
{
if (strpos($user_agent, 'Opera') || strpos($user_agent, 'OPR/')) return 'Opera';
elseif (strpos($user_agent, 'Edge')) return 'Edge';
elseif (strpos($user_agent, 'Chrome')) return 'Chrome';
elseif (strpos($user_agent, 'Safari')) return 'Safari';
elseif (strpos($user_agent, 'Firefox')) return 'Firefox';
elseif (strpos($user_agent, 'MSIE') || strpos($user_agent, 'Trident/7')) return 'Internet Explorer';
return 'Other';
}
$browser = get_browser_name($_SERVER['HTTP_USER_AGENT']);
if($browser == "Firefox"): ?> do something here <?php endif; ?>
now i want to add an if for the Safari but im not seeing how i can do it