Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Mengalikan setiap elemen array
<?php
$arr = [1, 2, 3, 4, 5];
foreach($arr as &$value) {
$value = $value * 2;
}
echo implode(', ', $arr), "\n";
// Hasil:
// 2, 4, 6, 8, 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment