Updated function and variable names to be more descriptive of their function to make it easier to read.

Added details to the comments.

Replaced a explode by "as" with a preg_split for case insensitivity.