<?php$arr = array ( 'FOO', 'FOO"', '"FOO', '"FOO"', 'xFOO', 'FOOy');print_r(preg_grep('/(?<!")FOO|FOO(?!")/', $arr));?>
Standard input is empty
Array ( [0] => FOO [1] => FOO" [2] => "FOO [4] => xFOO [5] => FOOy )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!