Add PHP function alternatives to the stored procedures

Just in case we want to use this instead. It would be a lot easier and cleaner in the long run.