3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $text = <<<TEXT Павел Дуров fsdf sdf sdf TEXT; $filter = 'Павел Дуров'; $filter = mb_strtolower($filter); $parts = explode(' ', $filter); $parts = array_map('trim', $parts); $parts = array_map('preg_quote', $parts); $filter = implode('.*', $parts); // echo preg_match("~{$filter}~uis", $text); $a = preg_split('/[x00-x21]+/uis', $text); // $a = array_map('trim', $a); // $a = array_filter($a); print_r($a);
Output for 7.1.7
Array ( [0] => Павел Дуров [1] => [2] => [3] => )