3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $tel_code = 44; $nos[] = '07905881965'; $nos[] = '+07905881965'; $nos[] = '7905881965'; foreach($nos as $no) { $composite = preg_replace('/^0?/', $tel_code, $no); var_dump($composite); }
Output for 4.3.0 - 7.2.0
string(12) "447905881965" string(14) "44+07905881965" string(12) "447905881965"