PHP MYSQL output views
I'm trying to use PHP change the way data is displayed for example
echo"<tr>";
echo "<td> DotNetFrameworkVersion </td>";
echo "<td>" . $row['DotNetFrameworkVersion'] . "</td>";
e开发者_如何学JAVAcho"</tr>";
is displayed like this: DotNetFrameworkVersion DF,1.1.4322,2.0.50727,3.0,4,4.0,
but I want it to look like this: DotNetFrameworkVersion DF, 1.1.4322, 2.0.50727, 3.0, 4, 4.0,
any help but be greatly appreciated
If it's comma delimated values you could just do something like:
echo "<td>" . str_replace(",", ", ", $row['DotNetFrameworkVersion']) . "</td>";
Or am I over simplifying?
This might work:
str_replace(",", ", ", $row['DotNetFrameworkVersion']);
It replaces the comma with a comma followed by a space.
Do you want to insert spaces after each comma?
You could try a string replace before it is echoed?
str_replace(',', ', ', $row['DotNetFrameworkVersion']);
精彩评论