formatted functions php a bit