mirror of
https://github.com/namibia/awesome-cheatsheets.git
synced 2024-11-24 05:37:39 +00:00
Fix php cheatsheet, for loop
iterates over all values, not just n-1 values
This commit is contained in:
parent
6c27bf77de
commit
e28a4a9cec
@ -24,7 +24,7 @@ foreach($arr as $key => $value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// For
|
// For
|
||||||
for($i = 0; $i < count($arr) - 1; $i++) {
|
for($i = 0; $i < count($arr); $i++) {
|
||||||
$key = $i;
|
$key = $i;
|
||||||
$value = $arr[$i];
|
$value = $arr[$i];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user