I have used implode to separate the array. What I want is that my ids should be shown in brackets separated by commas, but after the last string there will be no comma. How can I show them in brackets with no comma after the last string?
<html>
<head>
</head>
<body>
<?php
mysql_connect("localhost", "usename", "password") or die(mysql_error());
mysql_select_db("dbname") or die(mysql_error());
$ids=array();
$data = mysql_query("SELECT id FROM information");
while($row = mysql_fetch_assoc($data))
{
$ids[]=$row["id"];
}
echo implode(", ", $ids);
?>
</body>
</html>