protected function xmlToArray($xml)
    {
        // Do not output libxml error messages to screen
        $useErrors = libxml_use_internal_errors(true);
        $array = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);
        libxml_use_internal_errors($useErrors);

        // Fix the issue that XML parse empty data to new SimpleXMLElement object
        return array_map('strval', (array) $array);
    }
protected function xmlToArray($xml)
    {
        // Do not output libxml error messages to screen
        $useErrors = libxml_use_internal_errors(true);
        $array = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);
        libxml_use_internal_errors($useErrors);

        // Fix the issue that XML parse empty data to new SimpleXMLElement object
        return array_map('strval', (array) $array);
    }
protected function xmlToArray ( $ xml ) { // Do not output libxml error messages to screen $ useErrors = libxml_use_internal_errors ( true ) ; $ array = simplexml_load_string ( $ xml , 'SimpleXMLElement' , LIBXML_NOCDATA ) ; libxml_use_internal_errors ( $ useErrors ) ; // Fix the issue that XML parse empty data to new SimpleXMLElement object return array_map ( 'strval' , ( array ) $ array ) ; }
Convert XML string to array

@param string $xml
@return array
Convert XML string to array