Soapbox / laravel-formatter

A Formatter Class for Laravel 4 based on FuelPHP's Formatter Class
249 stars 95 forks source link

xml to array error #37

Closed W2YN closed 7 years ago

W2YN commented 7 years ago

use SoapBox\Formatter\Formatter; use SoapBox\Formatter\Parsers\ArrayParser;

$xml = '1234444H000011-00032auth error!'; $formatter = Formatter::make($xml, Formatter::ARR); $array = $formatter->toArray(); print_r($array); /////////////////////// output: unserialize(): Error at offset 0 of 199 bytes

W2YN commented 7 years ago

laravel 5.1

W2YN commented 7 years ago

I solved it.I passed the argument wrong $formatter = Formatter::make($xml, Formatter::XML);