implement random number generator myself in php