php处理xml

      $abc = "
        <xml>
            <toppings>
                <item>pepperoni</item>
                <item>tomato</item>
            </toppings>
        </xml>";
        $xml = simplexml_load_string($abc);
        dump($xml);exit;
        $data = json_decode(json_encode($xml),TRUE);
        dump($data['toppings']['item']['0']);exit;

你可能感兴趣的:(php处理xml)