function TmpCallTracking() {
$utm_source = $_GET['utm_source'];
$phone = '78122411466';
if (isset($_COOKIE['phone'])) {
$phone = $_COOKIE['phone'];
}
if ($utm_source == 'yandex'){
setcookie('phone','78121234567',time() + (60 * 60 * 24 * 30));
$phone = '78121234567';
}
return $phone;
}
$phone = '+' . TmpCallTracking();
$formatPhone = substr($phone, 0, 2).' ('.substr($phone,2,3).') '.substr($phone,5,3).'-'.substr($phone,8,2).'-'.substr($phone,10,2);
function getMenu() {
return '<ul><li><a href="tel: ' . $phone . '" class="dropdown-toggle"><i class="menu-icons-style radius-x fa fa-phone"></i> ' . $formatPhone . '</a></li></ul>';
}
Почему $phone и $formatPhone не отрабатывает?