When I want to implode I use $occu = implode(',',$_POST["occupation"]) and it implodes and the result is 1,2,4.
Now when I use $occu in query like below:
$total = DB::table('store')
->WhereIn('occupation_id',[$occu])
->get();
Then it only fetch the id 1 and not the 2 and 4.
But, if I use in this way:
$total = DB::table('store')
->WhereIn('occupation_id',[1,2,4])
->get();
Then it fetches all three ids.
Therefore, I want to know that why variable based implode first id is taken and not the other two.