New PIN generate function generatePIN($digits = 4){ $i = 0; //counter while($i < $digits){ //generate a random number between 0 and 9. $pin .= mt_rand(0, 9); $i++; } return $pin; } //If I want a 4-digit PIN code. $pin = generatePIN();
A Passionate full stack developer with 7 years of amazing experience in full stack application development and expertise in technologies like React Native, NextJS, ReactJS, Codeigniter, PHP , NodeJs. He has huge craze in learning new things about technologies and constantly shares his knowledge with others.