php helper class and function