Function __global->list_to_map

Definitions

sources/global3.php

  • Take a list of maps, and make one of the values of each array the index of a map to the map.list_to_map is very useful for handling query results.Let's imagine you get the result of SELECT id,title FROM sometable.list_to_map turns the array of rows into a map between the id key and each row.
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Return: array

Parameters

Name Type Default Set Range Description
$map_value ?string required parameter N/A N/A The key key of our maps that reside in our map (null: serialize the whole map)
$list array required parameter N/A N/A The list of maps

Return

  • The collapsed map
  • Type: array
  • Set: N/A
  • Range: N/A