Thread: xml..
View Single Post
Old 10-12-2007, 08:29 PM   #7 (permalink)
Tanax
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

HAH!
I solved it! :D:D

PHP Code:
$xmlstring = new SimpleXMLElement($xmlnulltrue);                
        
        foreach(
$xmlstring as $pics => $pic) {
            
            if(
$pic['id'] == $id) {
                
                echo 
$pic['info'];
                
            }
            
        } 
Code:
<?xml version="1.0" encoding="utf-8"?>
<pics>
    	<pic id="1" info="Testing1" />
	<pic id="2" info="Testing2" />
	<pic id="3" info="Testing3" />
	<pic id="4" info="Testing4" />
</pics>

Thanks so much!! :D
Tanax is offline  
Reply With Quote