Posted By

dimkalinux on 05/30/13


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

dimkalinux


Prices


 / Published in: PHP
 

  1. $prices = array();
  2.  
  3. $prices[] = array(
  4. "id" => "A",
  5. "allowedInCountry" => "CH",
  6. "disallowedInCountry" => "AT"
  7. );
  8.  
  9. $prices[] = array(
  10. "id" => "A",
  11. "allowedInCountry" => "DE",
  12. "disallowedInCountry" => ""
  13. );
  14.  
  15. $prices[] = array(
  16. "id" => "B",
  17. "allowedInCountry" => "DE",
  18. "disallowedInCountry" => ""
  19. );
  20.  
  21. $resultPrices = array();
  22.  
  23. // Start your code here.
  24.  
  25.  
  26.  
  27. // End your code here.
  28.  
  29. print_r($resultPrices);
  30.  
  31. // Result must be
  32. // Array
  33. // (
  34. // [A] => Array
  35. // (
  36. // [id] => A
  37. // [allowedInCountry] => Array
  38. // (
  39. // [0] => CH
  40. // [1] => DE
  41. // )
  42. // [disallowedInCountry] => Array
  43. // (
  44. // [0] => CH
  45. // )
  46. // )
  47.  
  48. // [B] => Array
  49. // (
  50. // [id] => B
  51. // [allowedInCountry] => Array
  52. // (
  53. // [0] => DE
  54. // )
  55. // [disallowedInCountry] => Array
  56. // (
  57. // )
  58. // )
  59. // )

Report this snippet  

You need to login to post a comment.