php code for function