misc php helpers