$ar = file("xml/Pages.xml"); foreach ($ar as $v) { if (substr($v,1,4) == "page") echo str_replace("page ","img ",$v); } ?>