PHP BY EXAMPLE
quote generator
slideshow generator
photo gallery generator
photo paginator gallery generator
address book
basic blog
paypal generator
sc simple cms

qg S2G : SLIDESHOW GENERATOR



Example

slideshow

PHP Code

  $targetpage = "index.php";
  $start=1;
  $limit=0;
  $folder=opendir("slideshow");
  $pic_types = array("jpg","jpeg","gif","png","pdf");
  $index=array();
  while($file = readdir($folder)) {
	if(in_array(substr(strtolower($file),strrpos($file,".")+1),$pic_types))
	{
		array_push($index,$file);
	}
  }
  $limit = (int)(count($index));
  
'; shuffle($index); for($i=$start;$i<$start+$limit;$i++) {


Slideshow <?php echo $i ?>-<?php echo $limit; ?>

}
closedir($folder);

PHP Code Explanation

Tweet Follow      © 2013 | webcula.com (all rights reserved) | php by example