Specific ideas for php to obtain local image files and generate xml file output_PHP tutorial

WBOY
Release: 2016-07-21 15:11:03
Original
835 people have browsed it

Copy code The code is as follows:

$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);
?>

Combined with the "AIR application calls the camera to take pictures and saves the photos to the local folder" released on this site Socket allows one computer to take photos and another computer to display the photos taken.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/326965.htmlTechArticleCopy the code as follows: ?php $dir="upload/"; $dir_res=opendir($dir); $fileFormat=array(0=".jpg",1=".gif",2=".png",3=".bmp"); $xmlData = ""; $xmlData .= "photosn"; while( $filen=...
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 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!