我正在开发一个模块,其中我将字符串存储在以逗号(,)分隔的列中,并且我已将字符串拆分为一个数组并将该数组添加到下拉列表中,但是当我对多个列执行此操作时,它没有排序下拉列表中的数组
这是代码
$pp=DB::table('gcp_projects')->where('niche','!=',' ')->where('niche','!=','')->where('niche','!=',null)->orderBy('niche')->pluck('niche');
$testing=explode(",",$pp);
$arr=array();
$tttt=array();
for($i=0;$i<=count($pp);$i++)
{
$arr= explode(",",$pp);
$temp = preg_replace("/[^a-zA-Z 0-9]+/", "", $arr);
$tttt=array_unique($temp);
sort($tttt);
}