By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,510 Members | 1,815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,510 IT Pros & Developers. It's quick & easy.

wrapping an if contruct

P: n/a
Is it possible to take an if contruct like this:

if ($mmaaccess == "yes") {
print "<img src='images/mma.jpg'>";
} else {
print "<img src='images/oa.gif'>";
}

and turn the whole thing into a variable $accessimage

I can't figure out how to wrap the whole thing.
Dec 6 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Fri, 07 Dec 2007 00:16:12 +0100, fu****@gmail.com <fu****@gmail.com
wrote:
Is it possible to take an if contruct like this:

if ($mmaaccess == "yes") {
print "<img src='images/mma.jpg'>";
} else {
print "<img src='images/oa.gif'>";
}

and turn the whole thing into a variable $accessimage

I can't figure out how to wrap the whole thing.
$accessimage = $mmaaccess == "yes" ? "<img src='images/mma.jpg'>" : "<img
src='images/oa.gif'>";
--
Rik Wasmus
Dec 6 '07 #2

P: n/a
On Dec 6, 6:39 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
On Fri, 07 Dec 2007 00:16:12 +0100, fur...@gmail.com <fur...@gmail.com>
wrote:
Is it possible to take an if contruct like this:
if ($mmaaccess == "yes") {
print "<img src='images/mma.jpg'>";
} else {
print "<img src='images/oa.gif'>";
}
and turn the whole thing into a variable $accessimage
I can't figure out how to wrap the whole thing.

$accessimage = $mmaaccess == "yes" ? "<img src='images/mma.jpg'>" : "<img
src='images/oa.gif'>";
--
Rik Wasmus
Perfect! Thanks a lot.
Dec 6 '07 #3

P: n/a
On Dec 6, 6:39 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
On Fri, 07 Dec 2007 00:16:12 +0100, fur...@gmail.com <fur...@gmail.com>
wrote:
Is it possible to take an if contruct like this:
if ($mmaaccess == "yes") {
print "<img src='images/mma.jpg'>";
} else {
print "<img src='images/oa.gif'>";
}
and turn the whole thing into a variable $accessimage
I can't figure out how to wrap the whole thing.

$accessimage = $mmaaccess == "yes" ? "<img src='images/mma.jpg'>" : "<img
src='images/oa.gif'>";
--
Rik Wasmus
Perfect! Thanks a lot.
Dec 6 '07 #4

P: n/a
fu****@gmail.com wrote:
On Dec 6, 6:39 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
>On Fri, 07 Dec 2007 00:16:12 +0100, fur...@gmail.com <fur...@gmail.com>
wrote:
>>Is it possible to take an if contruct like this:
if ($mmaaccess == "yes") {
print "<img src='images/mma.jpg'>";
} else {
print "<img src='images/oa.gif'>";
}
and turn the whole thing into a variable $accessimage
I can't figure out how to wrap the whole thing.
$accessimage = $mmaaccess == "yes" ? "<img src='images/mma.jpg'>" : "<img
src='images/oa.gif'>";
--
Rik Wasmus

Perfect! Thanks a lot.
So good, he said it twice!

Dec 7 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.