Here is my code: Basically, I'm trying to style the output of the array $ogh as it is a heading on my page. Can't seem to get the syntax right. (ive only put in part of the code, as this is the only thing giving me issues)
echo '<span class="productheading"> $ogh[$product] </span>'; else echo "Invalid";
Try this:
echo '<span class="productheading">'. $ogh[$product] .'</span>'; else echo "Invalid";
Use
echo '<span class="productheading">'. $ogh[$product].'</span>'; else echo "Invalid";
if ($ogh[$product] == '')
{
$product = 'Invalid';
}
else
{
$product = $ogh[$product];
}
echo '<span class="productheading">'.$product.'</span>';
Since you are using string manipulation you have to put your code in double quotation not single quotation since PHP doesn't process single quotation strings and print them as they are:
echo "<span class=\"productheading\"> $ogh[$product] </span>"; else echo "Invalid";