This question already has an answer here:
- Reference — What does this symbol mean in PHP? 18 answers
- The 3 different equals 5 answers
I'm processing a json from an url and showing some data. The problem is that I just want to display two accounts with certain id's but when I execute the following code is echoing the name of each account and not selecting the ones I choosen in the if-statement.
foreach ($data as $row) {
$id = $row->id;
$account = $row->account;
$time = date("Y-m-d H:i:s");
if ($id = 100) {echo $account;}
elseif ($id = 120) {echo $account;}
else {}
}
The Json is like
{"id":120,"Name":"Companytest"},
{"id":121,"Name":"BensonTillis"},
{"id":123,"Name":"JSBrothers"}
Thank you.
</div>