vendredi 26 février 2016

Unique Value from multidimensional array

I'm fetching data from database in multidimensional array like this

$par = [];
$var = DB::table('welcome_call_done')->where('state','LIKE', '%'. $states .'%')->where('city','LIKE', '%'. $citys .'%')->get();
foreach($var as $val)
{
    $prod = DB::table('welcome_call_product')->where(['assoc_id' => $val->assoc_id])->get();
    array_push($par, $prod);                           
}
$unique = array_map("unserialize", array_unique(array_map("serialize", $par)));

I want to display singles values but after execution is display multiple data. Please tell some solution to sort this problem.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire