Guest User

Untitled

a guest
Nov 30th, 2012
274
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $numbers = array(12, 26, 29, 30, 36, 38);
  3.  
  4. //Генерираме 6 произволни числа в диапазона от 1 до 49
  5. $othernumbers = range(1, 49);
  6. shuffle($othernumbers);
  7. $othernumbers = array_slice($othernumbers, 0, 6);
  8.  
  9. foreach($numbers as $key=>$value) {
  10.  
  11. $match = ($value == $othernumbers[$key])?'<font color="green">Да!</font>':'<font color="red">Не!</font>';
  12.  
  13.  
  14. // Извеждаме информацията!
  15. echo "
  16. Число от тиража: <b>$value</b>
  17. <br />
  18. Генерирано число: <b>$othernumbers[$key]</b>
  19. <br />
  20. Съвпадение: <b>$match</b>
  21. <hr />";
  22.  
  23. }
  24.  
  25. ?>
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×