3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "Apple is a big tech company!"; $search = 'Apple Logo a'; $pattern = '/\b('.str_replace(' ', '|', preg_quote($search, '/')).')\b/i'; $arr = preg_match_all($pattern,$string,$matches); print_r($arr); print_r($matches);

preferences:
37.84 ms | 407 KiB | 5 Q