Generate random numbers or OTP with function in PHP function generateNumericOTP($n=6) { $generator = "1357902468"; $result = ""; for ($i = 1; $i <= $n; $i++) { $result .= substr($generator, (rand()%(strlen($generator))), 1); } return $result; } generateNumericOTP(4);
We provide knowledgeable blogs related to php, jQuery, html, css, wordpress, woocommerce, cordova app with examples in 2021.