Reply
New Kid on the block - random file name generation
Old 02-23-2005, 12:09 PM New Kid on the block - random file name generation
Junior Talker

Posts: 1
Location: Redwood City
Hello,

I'm new so don't flame me too much but is there a function in PHP that will randomly generate file names? Thanx
ogian is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 02-23-2005, 12:15 PM
0beron's Avatar
Defies a Status

Posts: 1,832
Location: Somewhere else entirely
PHP Code:

$chars
=explode("," "a,b,c,d,e,f,g,h,i,j,k,l,
                      m,n,o,p,q,r,s,t,u,v,w,x,y,z,
                      A,B,C,D,E,F,G,H,I,J,K,L,M,
                      N,O,P,Q,R,S,T,U,V,W,X,Y,Z,
                      1,2,3,4,5,6,7,8,9,0,_"
);
$name '';
for(
$i 0$i $namelength$i++) {
$name .= $chars[rand(0,63)];
}
$name .= '.jpg'
Will give you names like "j3Cngl20Zla27.jpg"
You could also randomize the length of the names.
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';
Scribble Pad MOD for phpBB (aka MSN handwriting for forums)
0beron is offline
Reply With Quote
View Public Profile Visit 0beron's homepage!
 
Reply     « Reply to New Kid on the block - random file name generation
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.10577 seconds with 12 queries