Jump to content

newbieprogrammer

New Members
  • Posts

    2
  • Joined

  • Last visited

newbieprogrammer's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello Barand, Thank you very much for your time! During my brainstorming for possible solutions, I had entertained the thought of extracting 6 random numbers from the shuffled array. It is nice to see this is not a bad approach and that in your solution, this is brilliantly executed. Best wishes & stay safe, Ramon
  2. Hello everybody, I have been racking my brain trying to decipher something that should be really simple for a seasoned programmer. The following code shows random numbers from 0 to 60. How can I get the code to display six columns as opposed to ten? Support is much appreciated! Newbieprogrammer <html> <head> <?php mt_srand((double)microtime()*1000000); function Vullen() { $randomNr = array(0,1,2,3,4,5,6,7,8,9); shuffle($randomNr); return $randomNr; } $randomNr = Vullen(); function display($randomNr) { $table = '<table border="1px" cellpadding="1px">'; $bingokaart = array(); for ($row = 1; $row < 7; ++$row) { $table .= '<tr>'; foreach ($randomNr as $number) { $table .= '<td>'.$row.$number.'</td>'; } $table .= '</tr>'; } $table .='</table>'; echo $table; } display($randomNr); ?> </body> </html>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.