<?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. */
You have javascript disabled. You will not be able to edit any code.