-2

最終結果を次のようにしたいと思います。

Vendor1 => 'description1,description2,description3',
Vendor2 => 'description4,description5,description6'

現在、次のようなものがあります。

if(mssql_num_rows($execute)){
   while($row = mssql_fetch_array($execute)){
        $dropdown[$row['VendorName']] .=  "'" . $row['Transaction Description'] . "',";
   }
}

しかし、これは私に与えます:

["Harland Financial Solutions"]=>
  string(54) "'Software-implemention/license/support','sfw support',"
4

3 に答える 3

0
.
.
.
 $dropdown[$row['VendorName']] .=  $row['Transaction Description'] . ",";
.
.
.

あなたは次のように行うことができます

foreach ($dropdown as $vendor=>&$data)
$data=mb_substr($data,0,-1);//to remove the last , that you don't need
于 2013-05-07T21:43:43.170 に答える