3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //us-formatted: (xxx) yyy-wwuu note the spacing //int-formatted: +1 (xxx) yyy-wwuu note the spacing //click2call: +1xxxyyywwuu //plivo: xxxyyywwuu //mojo: tel:xxxyyywwuu $value = '0123456789'; echo '(' . substr($value, 0, 3) . ') ' . substr($value, 3, 3) . '-', substr($value, 6); echo '+1 (' . substr($value, 0, 3) . ') ' . substr($value, 3, 3) . '-', substr($value, 6); echo '+1' . $value; echo $value; echo 'tel:' . $value;
based on IuGa6
Output for 4.3.0 - 7.1.0
(012) 345-6789+1 (012) 345-6789+101234567890123456789tel:0123456789