wrapping an if contruct
am 07.12.2007 00:16:12 von furfey
Is it possible to take an if contruct like this:
if ($mmaaccess == "yes") {
print "";
} else {
print "";
}
and turn the whole thing into a variable $accessimage
I can't figure out how to wrap the whole thing.
Re: wrapping an if contruct
am 07.12.2007 00:39:52 von luiheidsgoeroe
On Fri, 07 Dec 2007 00:16:12 +0100, furfey@gmail.com =
=
wrote:
> Is it possible to take an if contruct like this:
>
> if ($mmaaccess == "yes") {
> print "";
> } else {
> print "";
> }
>
> and turn the whole thing into a variable $accessimage
>
> I can't figure out how to wrap the whole thing.
$accessimage =3D $mmaaccess == "yes" ? "=
" : "
src=3D'images/oa.gif'>";
-- =
Rik Wasmus
Re: wrapping an if contruct
am 07.12.2007 00:43:38 von furfey
On Dec 6, 6:39 pm, "Rik Wasmus" wrote:
> On Fri, 07 Dec 2007 00:16:12 +0100, fur...@gmail.com
> wrote:
>
> > Is it possible to take an if contruct like this:
>
> > if ($mmaaccess == "yes") {
> > print "";
> > } else {
> > print "";
> > }
>
> > and turn the whole thing into a variable $accessimage
>
> > I can't figure out how to wrap the whole thing.
>
> $accessimage = $mmaaccess == "yes" ? "" : "
> src='images/oa.gif'>";
> --
> Rik Wasmus
Perfect! Thanks a lot.
Re: wrapping an if contruct
am 07.12.2007 00:43:46 von furfey
On Dec 6, 6:39 pm, "Rik Wasmus" wrote:
> On Fri, 07 Dec 2007 00:16:12 +0100, fur...@gmail.com
> wrote:
>
> > Is it possible to take an if contruct like this:
>
> > if ($mmaaccess == "yes") {
> > print "";
> > } else {
> > print "";
> > }
>
> > and turn the whole thing into a variable $accessimage
>
> > I can't figure out how to wrap the whole thing.
>
> $accessimage = $mmaaccess == "yes" ? "" : "
> src='images/oa.gif'>";
> --
> Rik Wasmus
Perfect! Thanks a lot.
Re: wrapping an if contruct
am 07.12.2007 03:32:37 von Courtney
furfey@gmail.com wrote:
> On Dec 6, 6:39 pm, "Rik Wasmus" wrote:
>> On Fri, 07 Dec 2007 00:16:12 +0100, fur...@gmail.com
>> wrote:
>>
>>> Is it possible to take an if contruct like this:
>>> if ($mmaaccess == "yes") {
>>> print "";
>>> } else {
>>> print "";
>>> }
>>> and turn the whole thing into a variable $accessimage
>>> I can't figure out how to wrap the whole thing.
>> $accessimage = $mmaaccess == "yes" ? "" : "
>> src='images/oa.gif'>";
>> --
>> Rik Wasmus
>
> Perfect! Thanks a lot.
So good, he said it twice!