Created
November 26, 2016 01:00
-
-
Save chez14/e71c20c37f0b3aaeabe2c0fd37dde08f to your computer and use it in GitHub Desktop.
Nyobain
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 | |
$array = array ( | |
'foo', | |
'bar', | |
'baz' | |
); | |
$hasil = array(); | |
$count = count($array); | |
for ($i = 0; $i < $count; $i++) | |
$hasil=[$array[$count-$i-1]=>$hasil]; | |
// buat liat hasilnya | |
echo json_encode($hasil, JSON_PRETTY_PRINT); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment