Inserting a random number into an array [closed]

offset parameter of get_comments() function accepts integer values for more information visit this codex page.

so your get_comments function call should be as following.

$numbers = array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5);
$random_key = array_rand($numbers, 1);
$comments = get_comments(array('orderby' => 'comment_karma', 'number' => 20, 'status' => 'approve', 'offset' => $random_key));