Skip to content

Instantly share code, notes, and snippets.

@morozVA
Last active January 3, 2018 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morozVA/99bd577f0bbd27aab7fb78829fd7bea6 to your computer and use it in GitHub Desktop.
Save morozVA/99bd577f0bbd27aab7fb78829fd7bea6 to your computer and use it in GitHub Desktop.
evo snippet formatting_phones
/***********Форматирование телефона***************/
<a class="phone-a" href="tel:[[formatting_phones? &phone=`phone1`]]" title="">[!GetField? &docid=`2` &field=`phone1`!]</a>
<?php
$tv = $modx->getTemplateVar($phone, "",2);
$string = $tv['value'];
$string = preg_replace('~[^0-9+]+~','',$string);
return $string;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment