Jump to content

How do I itlaicize this?


pioneerx01

Recommended Posts

I am running a query from database tables and results are displayed in array for a drop down menu. The code looks like this

 

{
    echo 
	 "<option value='{$row['field1']} in {$row['field2']}'>{$row['field1']} in {$row['field2']}</option>";
}

 

I want the last "in {$row['field2']}" to be in italics. I can not seem to get it working.

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/222014-how-do-i-itlaicize-this/
Share on other sites

why do that when you can do this!!

 

<?php

function actuallyconvert($var) {
$var = "<i>".$var."</i>";
return $var;
}

function sendtoconverter($var) {
$var = actuallyconvert($var);
return $var;
}

function convert($var) {
$var = sendtoconverter($var);
return $var;
}
  
?>

 

 

<option value="<?PHP echo $row['field1'] . " in " . $row['field2']; ?>"><?PHP echo $row['field1'] . convert($row['field2']); ?></i></option>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.