开发者

How to display the result as a vertical list for this code?

My code is as shown.But the results are displayed as a horizontal list like this :

Questions selected

Explain how to produce the vector image, List THREE of image file types or formats used in multimedia, construct a diagram

$a= array(implode(", ", $_GET["choice"]));
echo "<table align=\"center\">";
echo "<tr><th>Question开发者_运维技巧s selected </th></tr>";



while (list ($key, $val) = each ($a)) { 
echo"<tr><td>";
echo " $val "; 
echo "</td></tr>";

}
echo "</table>";

I want them to be displayed like this :

Questions selected :
Explain how to produce the vector image
List THREE of image file types or formats used in multimedia 

So how can i list them 1 by 1 vertically ?Can somebody help me please ?I have tried putting them in table but i'm still getting them display horizontally.


You build $a as an array containing only one string. This is why it shows only one line.

implode takes and array, and join each item. If you want to separate a string into an array, you need to use explode.

Try with simply:

$a = $_GET["choice"];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜