IIF help

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
ericsodt
Forum Commoner
Posts: 51
Joined: Fri Aug 22, 2003 12:12 pm
Location: VA

IIF help

Post by ericsodt »

I have the function IIF:

function iif($expression,$true,$false){
if($expression){
return $true;
}else{
return $false;
}
}

When I call it:

<? iif(1=1,'yes', 'no'); ?>

I get a parse error... can anyone shed some light ontot this???
ericsodt
Forum Commoner
Posts: 51
Joined: Fri Aug 22, 2003 12:12 pm
Location: VA

Re: IIF help

Post by ericsodt »

fixed... nevermind

ericsodt wrote:I have the function IIF:

function iif($expression,$true,$false){
if($expression){
return $true;
}else{
return $false;
}
}

When I call it:

<? iif(1=1,'yes', 'no'); ?>

I get a parse error... can anyone shed some light ontot this???
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Share the light, how did you fix it?
Post Reply