我有一个来自数据库的数组,我只想留下productnames
没有要显示的数组结构。
public function selectAll ()
{
$stmt = Database::get()->query('SELECT `productname` FROM retrofootball_products');
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}
这个的输出是
Array ( [0] => Array ( [productname] => Manchester City 1981 Centenary FA Cup Final Shirt ) [1] => Array ( [productname] => Manchester City 1999 Playoff Winning Shirt ) )
我想留下来
Manchester City 1981 Centenary FA Cup Final Shirt, Manchester City 1999 Playoff Winning Shirt