3v4l.org

run code in 300+ PHP versions simultaneously
<?php $original_string = 'I like apples very much. I want an apple.'; $final_string = preg_replace("/(apples?)/", "_$1_", $original_string); echo $final_string;

preferences:
24.69 ms | 404 KiB | 5 Q