some useful php functions