変数があります。$id = 10
の中で使用する必要がありarray_walk()
ます。以下のように:
$id = 10;
array_walk($profile_items, function(&$a) {
$count = $this->db->where('profile_item_id', $a['id'])->where('cover_type_id', $id)->count_all_results('cover_type_profile_items_link');
$a['selected'] = $id;
});
echo "<pre>";
print_r($profile_items).exit;
$id
内部で変数を使用するarray_walk()
と、エラーが表示されます。
メッセージ: 未定義の変数: id
解決策はありますか?
アドバイスをありがとう