PHP 101 foreach

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.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mario tsai

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