PHP variables and XML elements

blinkyy

New Member
I'm trying to use PHP variables to load certain elements from a XML file, so if index.php?id=1 is loaded it would pull the information from $projects->project[1]. No errors come up in the following code, but nothing gets displayed. Any help is appreciated :)\[code\]<?php$projects = simplexml_load_file('portfolio.xml');$id = $_GET["id"];echo $projects->project[$id]->title;?> \[/code\]
 
Back
Top