Hi had a simillar problem with a long in script, I have taken the idea from there and came up with this i hope it helps
<?php
$xml = simplexml_load_file("photo.xml");
for ($i = 0; $i < count($xml); $i++){
if(isset($_GET["LocationName"]))
{
$photographer_id = $_GET["LocationName"];
}
$result = $xml->xpath('/root/area[photographer_id="' . $photographer_id . '"] ');
}
if(isset($_GET["photographer"]))
{
$photographer = $_GET["photographer"];
}
if(isset($_GET["images"]))
{
$image = $_GET["images"];
//$result = $xml->xpath('/root/area[photographer_id="' . $photographer_id . '"] and /root/area[photographer="' . $photographer . '"]');
}
//echo $photographer_id;
//echo $photographer;
//echo $image;
$filteredResult = array();
foreach($result as $obj){
if(in_array($photographer, (array)$obj) == 1 || $photographer == 'x'){
if(in_array($image, (array)$obj) || $image == 'x'){
array_push($filteredResult, $obj);
}
}
}
foreach($filteredResult as &$obj){
//how to access values in the object
echo $obj->{'photographer'};
echo $obj->{'image'};
}
echo $obj->{'image'};
?>
the last echo should give you some pointers