3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = array_reverse(explode(" ","This is a string, keyword next, some more text. keyword next-word.")); echo $string[array_search("keyword",$string) - 1]; /* OUTPUT next-word. */

preferences:
27.14 ms | 407 KiB | 5 Q