3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "abcdefghijklmnopqrstuvwxyz"; // just used as an example // $string becomes "badcfehgjilknmporqtsvuxwzy" $now_in_pairs = str_split($string, 2); $reverse = array_map('strrev', $now_in_pairs); foreach($reverse as $r) { $new_string .= $r; } echo $new_string;

preferences:
37.85 ms | 402 KiB | 5 Q