Author Topic: If $flashage is ABOVE a number  (Read 387 times)

0 Members and 1 Guest are viewing this topic.

Offline WarptweetTopic starter

  • Enthusiast
  • Posts: 306
    • View Profile
If $flashage is ABOVE a number
« on: January 18, 2007, 12:24:06 AM »
I use this code...

if($flashage=+3){
$flashrecommended = "ages 3 and above";
}

Although, I'm not sure if it will work.
How can I make it so that if $flashage is ABOVE 3?

Offline jesirose

  • Fanatic
  • Posts: 3,819
  • Gender: Female
  • PHP Goddess
    • View Profile
    • Reed's Training Blog
Re: If $flashage is ABOVE a number
« Reply #1 on: January 18, 2007, 12:25:58 AM »
if ($flashage > 3){
}

Right now you're (sorta but not really) setting it equal to itself plus 3.
Every time you post "It didn't work" without more explanation, God kills a kitten.
When you post code without code tags, He just teases a puppy. But it's still sad.
What does that php function do? | What does that term mean? | I don't see any errors! | Awesome API Interface
PHP Goddess with Attitude since 2004

Offline zhahaman2001

  • Enthusiast
  • Posts: 81
    • View Profile
Re: If $flashage is ABOVE a number
« Reply #2 on: January 18, 2007, 12:28:07 AM »
or if you need it to be > or = to then you can do this
if ($flashage >= 3){
}
« Last Edit: January 18, 2007, 12:29:53 AM by zhahaman2001 »

Offline WarptweetTopic starter

  • Enthusiast
  • Posts: 306
    • View Profile
Re: If $flashage is ABOVE a number
« Reply #3 on: January 18, 2007, 12:30:45 AM »
One more thing...

Does that make it:

The number is three OR above? Or above three?

Offline jesirose

  • Fanatic
  • Posts: 3,819
  • Gender: Female
  • PHP Goddess
    • View Profile
    • Reed's Training Blog
Re: If $flashage is ABOVE a number
« Reply #4 on: January 18, 2007, 12:31:45 AM »
I think our two comments made that pretty clear.
The less than, greater than and equal to symbols are taught in basic math.
> is greater than.
>= is greater than or equal to.
Every time you post "It didn't work" without more explanation, God kills a kitten.
When you post code without code tags, He just teases a puppy. But it's still sad.
What does that php function do? | What does that term mean? | I don't see any errors! | Awesome API Interface
PHP Goddess with Attitude since 2004