Try this - I'm not sure exactly HOW random it is but I'm sure if you use a long string it should be fine for your purposes:
srand((double)microtime()*1000000);
// symbols which are allowed in the string
$characters = "1,2,3,4,5,6,7,8,9,0,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,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";
$characters_length = (strlen($characters)-1)/2;
$token = explode(",",$characters);
// length of the password
$string_length=16;
for($i=0;$i<$string_length;$i++) {
$rand = rand(0,$characters_length);
$rand_str.= $token[$rand];
}
echo "$rand_str";
Good luck!