Home  >  Article  >  php教程  >  php获取本地图片文件并生成xml文件输出具体思路

php获取本地图片文件并生成xml文件输出具体思路

WBOY
WBOYOriginal
2016-06-13 11:53:24980browse

复制代码 代码如下:


$dir="upload/";
$dir_res=opendir($dir);
$fileFormat=array(0=>".jpg",1=>".gif",2=>".png",3=>".bmp");
$xmlData = "";
$xmlData .= "\n";
while($filen=readdir($dir_res))
{
for($i=0;$i{
if(substr($filen,strpos($filen,"."))==$fileFormat[$i])
{

$xmlData .= "\n";
$xmlData .= "" .$dir.$filen. "\n";
$xmlData .= "
\n";
break ;
}
}
}
$xmlData .= "
\n";
print $xmlData;
closedir($dir_res);
?>


跟本站发布的“AIR应用 调用摄像头拍照并保持照片到本地文件夹”结合加socket可实现一台电脑拍照,另一台电脑显示拍得的照片。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn