Even better php function