Page 1 of 1

If function

Posted: Fri Jan 16, 2009 11:14 am
by baardvidar
Hey, I have a question that should probably be easy for those of you who know php. As for myself I'm a newbie :? , and none of the tutorials I've found seem to answer this question:

I have a function that if it counts to 1 it generates some HTML code:

Code: Select all

if ($count == 1) :
What I want is for the same thing to happen if it counts to 2. I've figured out how to do this with an elseif, but it seems a waste of code. Anybody want to help me out?

Re: If function

Posted: Fri Jan 16, 2009 11:22 am
by Mark Baker

Code: Select all

if ($count <= 2)

Re: If function

Posted: Fri Jan 16, 2009 11:48 am
by baardvidar
As simple as that! Thanks!!