>  기사  >  백엔드 개발  >  回帖脱衣服的图片实现代码_PHP

回帖脱衣服的图片实现代码_PHP

WBOY
WBOY원래의
2016-06-01 11:55:551281검색

randimage.php

复制代码 代码如下:
/*
+---------------------------------------------------------+
| By Bleakwind http://www.weaverdream.com
+---------------------------------------------------------+
*/
$dir = "images/";//图片目录,注意是按照名字排序显示的...
$imgwidth = 0;//图片宽度,为0则为原始大小
$iforder = 1;//顺序显示还是随机显示,1为顺序显示,0为随机显示
$ifcircle = 0;//顺序显示的时候是否循环播放,1为循环播放,0为不循环

session_start();
if($imgwidth==0){$imgwidth=="";}else{$imgwidth=="width='".$imgwidth."'";}
$handle=opendir($dir);
while ($file_name=readdir($handle)){
if(($file_name!==".")&&($file_name!=="..")){$file_list[]=$file_name; }
}
closedir($handle);

if($iforder==1){
if(isset($_SESSION['sess_order'])){
if($_SESSION['sess_order']$_SESSION['sess_order']++;
}else{
if($ifcircle == 1){
$_SESSION['sess_order']=0;
}
}
}else{
$_SESSION['sess_order']=0;
}
$i=$_SESSION['sess_order'];
}else{
$num=count($file_list)-1;
$i=rand(0,$num);
}

readfile($dir.$file_list[$i]);
?>

调用

复制代码 代码如下:
回帖脱衣服的图片实现代码_PHP

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.