3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $mobileNumber = '+33631063771'; $mobileNumber = str_replace(' ', '', $mobileNumber); if (strpos($mobileNumber, '+') !== 0) { if (strpos($mobileNumber, '00') === 0) { $number = substr_replace('00', '+', 0, strlen($mobileNumber)); } elseif (strpos($mobileNumber, '0') === 0 || strpos($mobileNumber, '6') === 0 || strpos($mobileNumber, '7') === 0) { if (strpos($mobileNumber, '0') === 0) { $number = substr($mobileNumber, 1); } $number = '+33' . $number; } } echo $number;
based on fGvZY
Output for 5.3.20 - 7.2.0
Notice: Undefined variable: number in /in/5kFaH on line 17