PHP 101 foreach

Mario tsai
Apr 5, 2021

basic code with PHP

First, make a Int variable named “result”.($result)

Second, make a Array name “stock”.($stock)

Use Foreach.

  1. In Foreach, use $stock mean

foreach($stock as $key => $stock){

$result += $stock

}

isset($report[$key]) return true not null, return false means null.

--

--

Mario tsai

Major in physical education. Football referee. And high interest in looking the world through the numbers.