3v4l.org

run code in 300+ PHP versions simultaneously
<?php $articles = "Maybe it’s less true than it used to be that people are made of place--that the same elements that form coal and clay and bogs and ice form faces, voices and characters. I wrote my first collection of short stories, The Bostons, in homage to this book, hoping, as did Joyce’s young Stephen Dedalus, to encounter for the millionth time the reality of experience and to forge in the smithy of my soul the uncreated conscience of some island-dwellers I knew."; $keywords = "less true than, people are made, smithy of my soul, uncreated conscience, this is a test string"; $keywordsArray = explode(', ',$keywords); $pattern = '/'.implode('|',$keywordsArray).'/'; preg_match_all($pattern,$articles,$matches); var_dump($matches);

preferences:
43.67 ms | 402 KiB | 5 Q