fork download
  1. <?php
  2.  
  3. $cypher = "attack";
  4. $array1 = array_merge(range('A', 'Z'), range('a', 'z'));
  5. $array2 = str_split($cypher);
  6. //print_r($array1);
  7. echo "<br/>";
  8. print_r($array2);
  9. echo "<br/>";
  10. print_r(array_intersect($array1, $array2));
  11.  
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
<br/>Array
(
    [0] => a
    [1] => t
    [2] => t
    [3] => a
    [4] => c
    [5] => k
)
<br/>Array
(
    [26] => a
    [28] => c
    [36] => k
    [45] => t
)