Hello,
I am trying to make a script that will search through a string by how many characters it has and returns the character it lands on. For instance I have a 24 character string "ABCDEFGHIJKLMNOPQRSTUVWXYZ" And a random number is generated with mt_rand(1,24) and it equals three. How can I make php count to the third letter and add that letter into a variable? I've tried strlen() and I still can't figure it out. Im sure this is pretty simple but I appreciate it. Thank You
couple of things--first--if you wish to get any random letter, use mt_rand(0,25).
$alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; $temp=mt_rand(0,25); print $temp."-"; print $alpha[$temp]."<br>";