Re: IIF

From: Date: Wed, 14 May 2003 08:42:08 +0000
Subject: Re: IIF
References: 1  Groups: php.general.es 
Request: Send a blank email to general-es+get-36183@lists.php.net to get a copy of this message
> Sería hacer algo como esto: > > ----- > echo "<option>" . $valor . " " . > iif($valor==$variable,"selected","") . > "</option>"; > ----- Tu pregunta tiene una respuesta rápida, el equivalente a ese iif() sería algo como esto: echo "<option>" . $valor . " " .($valor==$variable ? "selected") . "</option>"; -- Rafael Montagud (a.k.a. Dranor) http://www.dranor.net

« previous php.general.es (#36183) next »