Home > php教程 > php手册 > body text

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

WBOY
Release: 2016-06-13 11:53:24
Original
998 people have browsed it

复制代码 代码如下:


$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可实现一台电脑拍照,另一台电脑显示拍得的照片。
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!