If function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
baardvidar
Forum Newbie
Posts: 2
Joined: Fri Jan 16, 2009 11:09 am

If function

Post 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?
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: If function

Post by Mark Baker »

Code: Select all

if ($count <= 2)
baardvidar
Forum Newbie
Posts: 2
Joined: Fri Jan 16, 2009 11:09 am

Re: If function

Post by baardvidar »

As simple as that! Thanks!!
Post Reply