$matches = array(); // Search for preg_match('/ 4) { return trim($matches[4]); } // Order of attributes could be swapped around: preg_match('/ 2) { return trim($matches[2]); } // No match return null; } ?>