0Day Forums
What does $settings['setting'] = "setting" Do? - Printable Version

+- 0Day Forums (https://zeroday.vip)
+-- Forum: Coding (https://zeroday.vip/Forum-Coding)
+--- Forum: CMS (https://zeroday.vip/Forum-CMS)
+---- Forum: MyBB (https://zeroday.vip/Forum-MyBB)
+---- Thread: What does $settings['setting'] = "setting" Do? (/Thread-What-does-settings-39-setting-39-quot-setting-quot-Do)



What does $settings['setting'] = "setting" Do? - gurjinderkrjidfghp - 07-26-2023

I am using a bulletin board called [mybb](http://www.mybb.com) and came across the following code:-

$settings['setting'] = "setting"

What does it do, google has failed me, because I don't know what to search for exactly.

How would I make use of it?


RE: What does $settings['setting'] = "setting" Do? - shuttleless608650 - 07-26-2023

I'm going to use different names so that you might see that the keyword 'setting' is in all 3 cases of your code, arbitrary:

$animals = array("cat"=>"mamal","ant"=>"insect");
$animals['cat']="insect";

the first line merely declares two key value pairs within an array called $animals
the second line merely sets the value of key 'cat' to "insect".

echo $animals['ant'];
this last code line should print "insect".




RE: What does $settings['setting'] = "setting" Do? - Sirfaceplate3 - 07-26-2023

This statement sets the value of the item in the array `$settings` identified by key `setting` to the string `"setting"`.

You would use it like this:-

$settings['setting'] = "setting";

And if, for example, you wanted to echo the value you would do so like this :-

echo $settings['settings'];