PHP & XML Help

Hey All,

I have my php code where I run through my xml and display images. But my propblem is that for a file that has three images listed for the item my code displays the following:

<img src="http://www.something.com/image1.jpg http://www.something.com/image2.jpg"

Here is my php code which I am trying to break up the array so it’s array[0] and array[1] etc…

And the XML looks like the following:


<PROPERTIES>
      <PROPERTY>
            <PHOTOS>
                  <PHOTO>
                        <PHOTOLINK>Image Link 1</PHOTOLINK>
                  </PHOTO>
                  <PHOTO>
                        <PHOTOLINK>Image Link 2</PHOTOLINK>
                  </PHOTO>
                  <PHOTO>
                        <PHOTOLINK>Image Link 3</PHOTOLINK>
                  </PHOTO>
            </PHOTOS>
       </PROPERTY>

case $xml_photo_key:
            $propertyDetailsArray[$counter]->PhotoLink .= $data;
            echo $data;
            //$propertyDetailsArray[$counter]->PhotoLink = substr($data,0);
            
            //$p_data = substr($data,0); 
            //$pics = trim($p_data);
            //$images = str_replace(".JPG",".JPG ",$pics);
            
            //print_r (explode(" ",$p_data));

            //echo $images;
            //echo "<br> *** $data *** <br>";
            //echo "".$propertyDetailsArray[$counter]->PhotoLink ."";
            break;

Any ideas how to split this up so it works by going $images[0]; and $images[1] etc…
at the moment it’s showing up like the following

$images[0] displays all three images instead of just one.

Thanks in advance :slight_smile: