There are associative arrays in php similar to dicionaries. Try looking at the documentation: http://php.net/manual/en/language.types.array.php
In python, you declare an empty dictionary as follows:
m_dictionary = {} #empty dictionary m_dictionary["key"] = "value" #adding a couple key-value print(m_dictionary)
The way to do the same in php is very similar to the python way:
$m_assoc_array = array();//associative array $m_assoc_array["key"] = "value";//adding a couple key-value print_r($m_assoc_array);
source share