An array contains a series of information. Retrieving a single piece of information involves iterating over a loop, such as foreach or calling the index directly using the array name and the index. For example,
In several places, I use information in the array to determine whether to load something else. For example, if the thread system is enabled then do something.
The challenge in the above code is first looking for the existence of the 'use_thread_system' index. If it doesn't exist then PHP returns a notice. The program now has a bug, as well as unexpected results.
A better way to write the conditional is to include the array_key_exists, which takes two parameters, the key and the array.