Created
April 30, 2019 18:18
-
-
Save bytefade/72e92ad4cf0ed7e154500fa0b551a9da to your computer and use it in GitHub Desktop.
Display URL WEB/API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Verificar se é mobile | |
$iphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone"); | |
$android = strpos($_SERVER['HTTP_USER_AGENT'],"Android"); | |
$palmpre = strpos($_SERVER['HTTP_USER_AGENT'],"webOS"); | |
$berry = strpos($_SERVER['HTTP_USER_AGENT'],"BlackBerry"); | |
$ipod = strpos($_SERVER['HTTP_USER_AGENT'],"iPod"); | |
if ($iphone || $android || $palmpre || $ipod || $berry == true) | |
{ | |
/* Habilitar diferente URL do WhatsApp conforme o dispositivo, | |
devido ao whatsapp não reconhecer no browser/mobile a mesma url, dá problemas. | |
*/ | |
// Mobile | |
$url_whatsapp = "api.whatsapp.com"; | |
}else{ | |
// Desktop | |
$url_whatsapp = "web.whatsapp.com"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment