I'm creating a security system in PHP which requires the user to enter a certain character from their unique security key, I was wondering how it is possible to make php return a selected character from a string.
For example, the security code is 1234567, I want php to randomly select 1 character from this string, and then compare that character to the character asked for in the security process
$number = rand(1,7); // The number = 7
E.G, please enter the 7th character of your security code.
//script to return the 7th character in the string and compare it to the entered character.
Thanks in advance :)