Want to create an array with key value pairs? Use the square bracket syntax:
1 2 3 | if (!empty($row["title"])) { $catList[$row["datasource_id"]] = $row["title"]; } |
$row["datasource_id"]
is the key for where the value of $row[“title”] is stored in.
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.