php helper functions