I have a problem with the formatting of phone numbers on my website written in PHP.
In this form, the user enters their phone number:
<div class="form-group">
<label class="control-label" for="phoneMobile">
<?php _e('Whatsapp "Recomendado"',); ?> <sup>*</sup>
</label>
<div class="controls">
<?php UserForm::mobile_text(osc_user()); ?>
</div>
</div>
After saving every process, the phone appears in the user profile:
<li>
<h3>Whatsapp</h3>
<h1 class="name"><i class="fa fa-whatsapp"></i><?php printf('%s', osc_user_phone_mobile()); ?></h1>
</li>
I'm looking for a way for the number to appear formatted in the following pattern (xx) xxxxx-xxxx without using plugins or JS. The form is Bootstrap.