开发者

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']);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜