Advertisement
Guest User

Untitled

a guest
Feb 8th, 2019
1,744
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.30 KB | None | 0 0
  1. <?php
  2. $firstArray = explode(" ", readline());
  3. $secondArray = explode(" ", readline());
  4.  
  5. for ($i = 0; $i < count($secondArray); $i++) {
  6.     for ($j = 0; $j < count($firstArray); $j++) {
  7.         if ($secondArray[$i] === $firstArray[$j]) {
  8.             echo "$secondArray[$i] ";
  9.         }
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement