Jump to content

Parsing XML cdata


31special

Recommended Posts

I'm trying to parse the contents of xml tag <g:location> into 4 different elements of an array.

 

Example XML Tag:

 

<g:location><![CDATA[Fort Meade]]>, <![CDATA[MD]]> <![CDATA[20755-6779]]> <![CDATA[united States]]></g:location>

 

 

Array Example:

 

 

      $my_location= array(

              'city'           => array('<g:location><![CDATA[', ']]></g:location>'),

              'state'          => array('<g:location><![CDATA[', ']]></g:location>'),

              'zipcode'        => array('<g:location><![CDATA[', ']]></g:location>'),

              'country'        => array('<g:location><![CDATA[', ']]></g:location>'),

      )

;

 

 

What is the proper way to put the <g:location> tag into those 4 different elements?

Link to comment
https://forums.phpfreaks.com/topic/166733-parsing-xml-cdata/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.