helper functions for php that may or may not come in handy