Some useful php functions/utils