<?php $strings = [ "i like to eat apple", "orange", "Surprise!" ]; foreach ($strings as $string) { echo preg_replace_callback( '~[a-z]+(?=[^a-z]*$)~i', fn($m) => strrev($m[0]), $string ); echo "\n---\n"; }
You have javascript disabled. You will not be able to edit any code.