fork(1) download
  1. <?php
  2.  
  3. $ara=array(1,3,5,6);
  4. $dlina=count($ara);
  5.  
  6. $ara2=array(1,2,5,2);
  7. $dlinaAra2=count($ara2);
  8. $ara3=array();
  9. for ($i=0; $i <= $dlina; $i++){
  10.  
  11. for ($k=0; $k<=$dlinaAra2-1;$k++){
  12. if ($ara[$i]==$ara2[$k]){
  13. $ara3[]=$ara2[$k];
  14. }
  15. }
  16. }
  17. print_r($ara3);
  18. ?>
Success #stdin #stdout #stderr 0.03s 52480KB
stdin
Standard input is empty
stdout
Array
(
    [0] => 1
    [1] => 5
)
stderr
PHP Notice:  Undefined offset: 4 in /home/jNrwV9/prog.php on line 12
PHP Notice:  Undefined offset: 4 in /home/jNrwV9/prog.php on line 12
PHP Notice:  Undefined offset: 4 in /home/jNrwV9/prog.php on line 12
PHP Notice:  Undefined offset: 4 in /home/jNrwV9/prog.php on line 12