XPath-like functionality for PHP arrays