I have two arrays:
$anna_array = array("soccer" => "10", "basketball" => "20", "tennis" => "30", "atletics" => "40", "volleyball" => "50");
$john_array = array("soccer" => "15", "basketball" => "15", "atletics" => "45");
Explanation
The score of Anna at Soccer is 10 and of John is 15 and so on.
I want to return the same activities in both arrays. Something like:
Anna activities: Soccer = 10 - Basketball = 20 - Atletics = 40.
John activities: Soccer = 15 - Basketball = 15 - Atletics = 45.
Can anyone help me with this?
afor Anna, andjfor John that are 0 and during the comparison (inside the if block) you can incrementaorj.