Array based expression matching in PHP