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 | |
require_once('./json.php'); //Importing the data file assuming it lies in the same directory as challenge.php file | |
$peopleArray = json_decode($people)->data; | |
//Making an array with all the emails and adding an extra property to $peopleArray | |
foreach($peopleArray as $key => $peopleObj){ | |
$emails[] = $peopleObj->email; | |
$peopleObj->name = $peopleObj->first_name.' '.$peopleObj->last_name; |