0

I've to extract some info from a xml file. The tag pictures is like the following:

<pictures>
  <picture>
    <picture_url>
     <![CDATA[
        http://www....jpg
     ]]>
    </picture_url>
  </picture>
  .
  .
  .
</pictures>

I don't try to parse it to extract picture_url for every .

I try to print this content but the result is the following:

object(SimpleXMLElement)#258 (1) {
  ["picture"]=>
  array(5) {
    [0]=>
    object(SimpleXMLElement)#966 (1) {
      ["picture_url"]=>
      object(SimpleXMLElement)#973 (0) {
      }
    }
    [1]=>
    object(SimpleXMLElement)#968 (1) {
      ["picture_url"]=>
      object(SimpleXMLElement)#973 (0) {
      }
    }
    [2]=>
    object(SimpleXMLElement)#972 (1) {
      ["picture_url"]=>
      object(SimpleXMLElement)#973 (0) {
      }
    }
    [3]=>
    object(SimpleXMLElement)#974 (1) {
      ["picture_url"]=>
      object(SimpleXMLElement)#973 (0) {
      }
    }
    [4]=>
    object(SimpleXMLElement)#970 (1) {
      ["picture_url"]=>
      object(SimpleXMLElement)#973 (0) {
      }
    }
  }
}

how can I trace the photo url?

Many thank's!

  • Please go read [ask]. We expect you to describe what your specific problem is here, and not just ask “can you help me”. – 04FS May 06 '19 at 10:55
  • @Artem, I saw this post but it didn't help me because my cdata tag is a sub-tag of other tags –  May 06 '19 at 10:58
  • _“because my cdata tag is a sub-tag of other tags”_ - so what, the accepted answer in the duplicate basically covers that as well already. And in any case, you should _not_ give such statements here anyway - _show us_ what you tried, and properly explain what the problem with that was. – 04FS May 06 '19 at 11:16

0 Answers0