PHP helper functions that may come in hany in certain situations (they can also be turned into methods, believe it or not)