So use count(): http://php.net/manual/en/function.count.php
$count = count($array);
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
i am passing the array from one view to another, there i am retriving data also but i need the array count how to get that count
public function pass_device_array(Request $request,$id, $enqid){
$man=explode(',', $id);
$row = DB::table('device')->whereIn('id',$man)->pluck('id');
$row1 = DB::table('Enquiry')->where('id',$enqid)->first();
return view('pages.newinvoice', ['row' => $row, 'row1' => $row1]);
}
$man is having the list of array....
i need one more variable to hold the count of $id
how to do this
Please or to participate in this conversation.