Last active
October 13, 2021 11:17
-
-
Save catwhocode/02a466ccc87c905aa39c790086b63a1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// kalikan semua elemen array dengan bilangan 10 | |
$arr = [1,2,3,4,5,6]; | |
function kalikan($arr) { | |
foreach($arr as $key => $value) { | |
$arr[$key] = $value * 10; | |
} | |
return $arr; | |
} | |
print_r(kalikan($arr)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment