Array
(
[0] => Array
(
[0] => x y x
)
[1] => Array
(
[0] => x
)
)
preg_match_all('/(x|y)(?=.*?x)/', 'x y x', $match);
var_dump($match);
array(2) {
[0]=>
array(2) {
[0]=>
string(1) "x"
[1]=>
string(1) "y"
}
[1]=>
array(2) {
[0]=>
string(1) "x"
[1]=>
string(1) "y"
}
}