經安全檢測,此網站為安全網站,請放心前往原始網址!

php - how can I add key value pairs to an array? - Stack Overflow

You can create the single value array key-value as $new_row = array($row["datasource_id"]=>$row["title"]); inside while loop, and then use array_merge function in loop to combine the each new $new_row array.

stackoverflow.com

網址安全性掃描由 google 提供