Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [wholesalePrices] => Array
- (
- [0] => Array
- (
- [quantity] => 10
- [price] => 9.99
- )
- [1] => Array
- (
- [quantity] => 25
- [price] => 8
- )
- [2] => Array
- (
- [quantity] => 50
- [price] => 6
- )
- [3] => Array
- (
- [quantity] => 100
- [price] => 4
- )
- <form>
- <input type="text" name="quantity" placeholder="Quantity" />
- <input type="text" name="price" placeholder="Costing" readonly />
- <input type="submit" name="submit" value="Show Cost" />
- </form>
- $data['wholesalePrices'] =
- array(
- 'quantity' => 10, 'price' => 9.99,
- 'quantity' => 25, 'price' => 8,
- 'quantity' => 50, 'price' => 6,
- 'quantity' => 100, 'price' => 4
- );
- $qty = $_POST['quantity'];
- if(in_array($qty , $data['wholesalePrices'])) {
- echo "price exist";
- } else {
- echo "Not Matched";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement