第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

通過(guò)“helper”函數(shù)創(chuàng)建 key => value 數(shù)組

通過(guò)“helper”函數(shù)創(chuàng)建 key => value 數(shù)組

PHP
暮色呼如 2023-09-15 10:40:45
我有一個(gè)具有以下值的二維數(shù)組:  [    'id' => 12,    'title' => 'the title', //and a few other key => value    ],        [    'id' => 13,    'title' => 'the title 13', // and a few other key => value    ],...最后,我需要一個(gè)只有id 和 title的多維數(shù)組[ $item['id'] => $item['title'], ...]通常,我會(huì)做一個(gè)簡(jiǎn)單的 foreach 來(lái)實(shí)現(xiàn)這一點(diǎn),但我現(xiàn)在想使用 php 函數(shù)。我已經(jīng)這樣做了,但是有正確的方法嗎?$list = array_combine(array_column($list_forms, 'id'), array_column($list_forms, 'title'));
查看完整描述

1 回答

?
慕仙森

TA貢獻(xiàn)1827條經(jīng)驗(yàn) 獲得超8個(gè)贊

第三個(gè)參數(shù)是:array_column

$list?=?array_column($list_forms,?'title',?'id');


查看完整回答
反對(duì) 回復(fù) 2023-09-15
  • 1 回答
  • 0 關(guān)注
  • 91 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)