[ create a new paste ] login | about

Project: baylorrae
Link: http://baylorrae.codepad.org/7yZkr7Bp    [ raw code | output | fork ]

BaylorRae - PHP, pasted on Oct 18:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php

$_POST_EXAMPLE = array();
$_POST_EXAMPLE['ratings'] = array(
  'snickers' => 2,
  'twix' => 1,
  'butterfinger' => 3
);

$ratings = array_unique($_POST_EXAMPLE['ratings']);

// Two of the candy bars had the same rating
if( count($ratings) !== 3 ) {
  echo 'ERROR MSG HERE!';
}else {
  echo 'Success!';
}


Output:
1
2

Success!


Create a new paste based on this one


Comments: