3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $input = "30.10.2012"; $input = "2012-10-30"; $reverse = true; $inputSplitChar = $reverse === false ? '.' : '-'; $OutputSplitChar = $reverse === false ? '-' : '.'; $resultArray = array_map('strrev', explode($inputSplitChar, strrev($input))); $result = implode($OutputSplitChar, $resultArray); echo $result;
Output for 4.3.0 - 7.1.0
30.10.2012