9951 explained code solutions for 126 technologies


phpFind the position of a letter in the alphabet


$alphabet = 'abcdefghijklmnopqrstuvwxyz';
$to_find = 'e';
echo strpos($alphabet, $to_find) + 1;ctrl + c
$alphabet

the 'haystack', the string to be searched

$to_find

the 'needle', the string to search for

strpos(

finds the position of...

+ 1

add to the index by one (to make up for indexing arrays from 0)