I’m not 100% but this ($settings) would be called an array in php:
$setting;
$setting['host'] = "localhost";
$setting['name'] = "hello";
but what’s the name for this that’s different to the above:
$settings = array("localhost", "hello");
Also from the first example how can i remove the element called name?
(please also correct my terminology if I have made a mistake)
You should be 100% sure, they are 🙂
This:
And this are different ways of declaring a php array.
In fact this is how later should be to match the first one with keys:
You can remove with
unset:Note that when declaring PHP array, do:
Rather than:
Note also that you can append info to arrays at the end by suffixing them with
[], for example to add third element to the array, you could simply do:More Information:
http://php.net/manual/en/language.types.array.php