I have 2 arrays : 1 is all the alphabets and the other is a word which will be encrypted.
Problem : How can I have my program echo the array intersection but with the position of the intersection from the first array. So, I don't want "c" to have a position of 1 from the second array but rather a position of 3 in the first array.
PHP Code :
<?php
$cypher = $_POST['cypher_text'];
$array1 = array_merge(range('A', 'Z'), range('a', 'z'));
$array2 = str_split($cypher);
print_r($array1);
echo "<br/>";
print_r($array2);
echo "<br/>";
print_r(array_intersect_key($array2, $array1));
?>