Question:What will the following script output?
<?php
$array = '0123456789ABCDEFG';
$s = '';
for ($i = 1; $i < 50; $i++) {
  $s .= $array[rand(0,strlen ($array) - 1)];
}
echo $s;
?>
 

A A string of 50 random characters 

B A string of 49 copies of the same character, because the random number generator has not been initialized 

C A string of 49 random characters 

D Nothing, because $array is not an array 

E A string of 49 ‘G’ characters 

+ Answer
+ Explanation
+ Report
Total Preview: 944

Copyright © 2024. Powered by Intellect Software Ltd