Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function getProductPictures($index)
- {
- $images = array();
- for($i=0;$i<10;$i++)
- {
- $filepath = "images/".$index."-".$i.".jpg";
- if(file_exists($filepath))
- {
- $images[] = $filepath;
- }
- }
- return $images;
- }
- function random_session_id(){
- $utime = time();
- $id = random_salt(40-strlen($utime)).$utime;
- return $id;
- }
- function random_salt($len)
- {
- return random_text;
- }
- function random_text($len){
- $base = 'QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890';
- $max = strlen($base)-1;
- mt_srand((double)microtime()*1000000);
- while(strlen($rstring) < $len)
- $rstring.=$base(mt_rand(0, $max));
- return $rsting;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement