Why does SimpleXML change my array to the array's first element when I use it?

前端 未结 5 1146
予麋鹿
予麋鹿 2021-01-04 20:18

Here is my code:

$string = << 

 
  hello
  there<         


        
5条回答
  •  鱼传尺愫
    2021-01-04 20:42

    Ran into this issue...

    Xpath can be a little slow, so you can achieve the same effect with a simple for loop.

    for ($i = 0; $i < count($xml->testing->lol); $i++) {
        print_r($xml->testing->lol[$i]);
    }
    

提交回复
热议问题