-2

i collect data using GET.

product=shoes&amount=30

so i collect the data

$amount = $_GET['amount'];

How do i echo out a message if the amount is not in increments of 10, so for example if amount was 25, i want to echo out saying "Amount needs to be in increments of 10". I have no code examples as i have tried to google this and can't find anything and i don't know where to even begin.

So i have not tried anything.

user3485335
  • 45
  • 1
  • 9

1 Answers1

1

Try this:

$amount = $_GET['amount'];
if($amount%10!=0){
    echo "Amount needs to be in increments of 10";
}
Hetal Chauhan
  • 787
  • 10
  • 22