Created
April 7, 2017 07:50
-
-
Save kraizt/87516d274cff420735b55e2566e4b980 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$input_one = ['Ricky Andika Putra', 'Ramadani', 'Asep Dadang Supriadi', 'Akmal Fuady', 'Yandi Fitriyanto']; | |
$input_two = ['Ricky Andika Putra', 'Yandi Fitriyanto', 'Muhammad Sholeh', 'Yadi Cahyadi']; | |
$result = array_count_values(array_merge($input_one, $input_two)); | |
foreach ($result as $key => $value) | |
{ | |
if($value == 2) | |
{ | |
$hasil[] = $key; | |
} | |
} | |
print_r($hasil); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment