Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.78 KB | None | 0 0
  1. <?php
  2. $i = 1;
  3.  
  4. foreach ($_GET['package'] as $key => $value) {
  5.     if (empty($value)) {
  6.     unset($key);
  7.     }
  8.    
  9.     if ($value > 1) {
  10.    
  11.         echo "<br /><strong>Package: ". $key."</strong><br />";
  12.         while ($i <= $value) {
  13.             echo $i . "<br />";
  14.             $i++;
  15.         }
  16.         echo "<br />"; 
  17.     }
  18. }
  19.  
  20. echo "<pre>";
  21. print_r($_GET);
  22. echo "</pre>";
  23.  
  24. /*
  25.  
  26. Package: 1
  27. 1
  28. 2
  29.  
  30.  
  31. Package: 2
  32. 3
  33. 4
  34. 5
  35.  
  36. Array
  37. (
  38.     [title] => Miss
  39.     [first_name] =>
  40.     [surname] =>
  41.     [dob] =>
  42.     [phone_number] =>
  43.     [email] =>
  44.     [address1] =>
  45.     [address2] =>
  46.     [town] =>
  47.     [post_code] =>
  48.     [package] => Array
  49.         (
  50.             [1] => 2
  51.             [2] => 5
  52.             [3] =>
  53.             [4] =>
  54.             [5] =>
  55.             [6] =>
  56.             [7] =>
  57.         )
  58.  
  59. )
  60. */
  61. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement