- array_rand: documentation ( source)
<?php
$random_string = function($length) {
$bag = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$string = '';
while ($length--) {
$string .= $bag[array_rand($bag)];
}
};
$client_id = $random_string(2);