prova a guardare qui..

http://www.phpclasses.org/browse/class/65.html