switched to mb_string functions
added mock functions to validate types and values
added link to the original blog post