1
1
mirror of https://github.com/namibia/awesome-cheatsheets.git synced 2025-01-24 07:38:28 +00:00

Merge pull request #110 from janstuemmel/patch-1

Fix php cheatsheet, for loop
This commit is contained in:
Julien Le Coupanec 2020-01-22 00:13:37 +01:00 committed by GitHub
commit 08f4e886d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,7 @@ foreach($arr as $key => $value) {
}
// For
for($i = 0; $i < count($arr) - 1; $i++) {
for($i = 0; $i < count($arr); $i++) {
$key = $i;
$value = $arr[$i];
}
@ -338,4 +338,4 @@ class ClassWithLogger
* Use the LoggerAwareTrait in this class.
*/
use LoggerAwareTrait;
}
}