I don't want to print it out right away, I want it to end up in a new variable that I can use later.
Let say it all end up with the variable $test
If the color is #ffffff the variable $test will show the picture error.gif
But if the color is #fe0104 the variable $test will show the picture varning3.gif instead.
Code: Select all
if ($WarnColor=="#ffffff")
{
echo "<img src='Varningar/error.gif'>";
}
elseif ($WarnColor=="#29d660")
{
echo "img src='Varningar/ingen_varning.gif'";
}
elseif ($WarnColor=="#ffff00")
{
echo "<img src='Varningar/varning1.gif'>";
}
elseif ($WarnColor=="#fecb31")
{
echo "<img src='Varningar/varning2.gif'>";
}
elseif ($WarnColor=="#fe0104")
{
echo "<img src='Varningar/varning3.gif'>";
}
else
{
echo "Something has gone terribly wrong - time to shut down";
}