Read XML PHP Internal and External -


how read xml?

<?xml version="1.0" encoding="utf-8"?> <response parte="01" total="01">     <style>     <color="000000" name="black" status="3" erro="0"/>     <color="0000ff" name="blue" status="3" erro="0"/>     <color="ff0000" name="red" status="2" erro="0"/>     </style> </response> 

i got see print_r, print lines of color. ex.:

1: 000000 - black - 3 - 0

2: 0000ff - blue - 3 - 0

3: ff0000 - red - 2 - 0

does have idea? thanks.

if not valid xml, have deal output string

$string = '<response parte="01" total="01">     <style>     <color="000000" name="black" status="3" erro="0"/>     <color="0000ff" name="blue" status="3" erro="0"/>     <color="ff0000" name="red" status="2" erro="0"/>     </style> </response>';  preg_match_all('/color="(.*?)" name="(.*?)" status="(.*?)" erro="(.*?)"/', $string, $match); unset($match[0]); var_dump($match); 

Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -