개요
- PHP 딕셔너리 for루프
<?php
$arr = [ 'id'=> 42, 'name'=>'John Smith', 'birthyear'=>2000 ];
foreach( $arr as $key => $value ) {
echo "$key: $value\n";
}
# id: 42
# name: John Smith
# birthyear: 2000
<?php
$arr = [ 'id'=> 42, 'name'=>'John Smith', 'birthyear'=>2000 ];
foreach( $arr as $key => $value ) {
echo "$key: $value\n";
}
# id: 42
# name: John Smith
# birthyear: 2000