Advertisement
Guest User

Untitled

a guest
May 5th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <?php
  2. function getProductPictures($index)
  3. {
  4. $images = array();
  5.  
  6. for($i=0;$i<10;$i++)
  7. {
  8. $filepath = "images/".$index."-".$i.".jpg";
  9. if(file_exists($filepath))
  10. {
  11. $images[] = $filepath;
  12. }
  13. }
  14. return $images;
  15. }
  16.  
  17. function random_session_id(){
  18. $utime = time();
  19. $id = random_salt(40-strlen($utime)).$utime;
  20. return $id;
  21. }
  22.  
  23. function random_salt($len)
  24. {
  25. return random_text;
  26. }
  27.  
  28. function random_text($len){
  29. $base = 'QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890';
  30. $max = strlen($base)-1;
  31. mt_srand((double)microtime()*1000000);
  32. while(strlen($rstring) < $len)
  33.  
  34. $rstring.=$base(mt_rand(0, $max));
  35.  
  36. return $rsting;
  37. }
  38.  
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement