<script>
function showTooltip()
{
var myDiv = document.getElementById('tooltip');
var myLink = document.getElementById('link');
if(myDiv.style.display == 'none')
{
myDiv.style.display = 'block';
myLink.style.display = 'none';
}
else {
myDiv.style.display = 'none';
}
return false;
}</script>
<a href='javascript:;' onclick=showTooltip() id="link"> +38xxx-xxx-xx-xx </a>
<div id=tooltip style='display: none'><?php echo $agent_mobile; ?></div>
var selector = '.work-1, .work-2, .work-3';
$(selector).find('> img').click(function () {
$(selector).not($(this).parent()).removeClass('active');
$(this).parent().toggleClass('active');
});
https://api.telegram.org/bot[ТОКЕН_БОТА]/sendMessage?chat_id=@[USERNAME_КАНАЛА]&text=тест
. После перехода по ссылке будет выведен id канала, сохрани его. https://api.telegram.org/bot[ТОКЕН_БОТА]/sendMessage?chat_id=@[ID_КАНАЛА]&text=тест.
RewriteEngine On
RewriteCond %{HTTPS} =off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L]
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
echo format_phone('7wer9e85w11-1"!1н1*11'); // вернет: +7 (985) 111-11-11
function format_phone($phone = '')
{
$phone = preg_replace('/[^0-9]/', '', $phone); // вернет 79851111111
if (strlen($phone) != 11 and ($phone[0] != '7' or $phone[0] != '8')) {
return FALSE;
}
$phone_number['dialcode'] = substr($phone, 0, 1);
$phone_number['code'] = substr($phone, 1, 3);
$phone_number['phone'] = substr($phone, -7);
$phone_number['phone_arr'][] = substr($phone_number['phone'], 0, 3);
$phone_number['phone_arr'][] = substr($phone_number['phone'], 3, 2);
$phone_number['phone_arr'][] = substr($phone_number['phone'], 5, 2);
$format_phone = '+' . $phone_number['dialcode'] . ' ('. $phone_number['code'] .') ' . implode('-', $phone_number['phone_arr']);
return $format_phone;
}