これはブラウザで正常に動作していますが、ios 用の空気には完全なアドレスが必要です。
<?php $path_to_image_dir = 'Games/game_images/'.$username;
$xml_string = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?><data> <LoaderMax name=\"gallery\">";
if ( $handle = opendir( $path_to_image_dir ) ) {
$i = 1;
while (false !== ($file = readdir($handle))) {
if ( is_file($path_to_image_dir.'/'.$file) ) {
$xml_string .= "<ImageLoader url=\"" . $path_to_image_dir."/".$file . "\" />";
}
}
closedir($handle);
}
$xml_string .= "</LoaderMax></data>";
$ignore = array('.','..','cgi-bin','.DS_Store');
$file = fopen($username.'_imagesfile.xml','w');
fwrite($file, $xml_string);
fclose($file);
?>
これはxmlの結果です:
<?xml version="1.0" encoding="iso-8859-1"?><data> <LoaderMax name="gallery"><ImageLoader url="Games/game_images/mrpeepers/1365535674.jpg" /><ImageLoader url="Games/game_images/mrpeepers/1365535527.jpg" /></LoaderMax></data>
アドレスが手で追加された場合、iosで動作しますhttp://wwww.mysite.ccom/Games/game_images/mrpeeper/1365535674.jpg