Web Hosting Talk







View Full Version : Another really quick PHP question


Looie
11-30-2007, 08:41 PM
How many times you can you use "elseif"?

Thanks.

Looie
11-30-2007, 08:43 PM
Wait, nevermind. Figured it out.

bear
11-30-2007, 10:37 PM
Thankfully no one else will ever come along and have the same question...elsif they wouldn't know the answer. :angel:

oxyfactor
12-01-2007, 05:13 AM
u can use it indefinitely cant u? lol.

flashwebhost
12-01-2007, 06:56 AM
It is unlimited, feel free to use it.

0 times, if you use switch() :)

Looie
12-04-2007, 04:25 PM
yeah, I used


if ( strstr($p, "01") )
header ("location: domain.com/page1.php");
elseif ( strstr($p, "02") )
header ("location: domain.com/page2.php");
elseif ( strstr($p, "03") )
header ("location: domain.com/page3.php");
else
echo "Page doesn't exist";

orbitz
12-04-2007, 07:38 PM
How many times you can you use "elseif"?

Thanks.

How many do you plan to use?
Also, look at how "switch" can be used:

http://us2.php.net/manual/en/control-structures.switch.php

note: php.net can be very helpful to you. I use it all the time.