3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function randStr($length = 32, $chars = 'abcdefghijklmnopqrstuxyvwzABCDEFGHIJKLMNOPQRSTUXYVWZ!@#$%&*()_-+=') { //function randStr($length, $chars) { $validCharNumber = strlen($chars); for ($i = 0; $i < $length; $i++) { $str .= $chars[rand(0, $validCharNumber - 1)]; } return $str; }
Output for 4.3.0 - 7.1.0