I know how to combine two arrays in foreach loop using array_combine() function of PHP
array_combine()
But I have three arrays and I want to loop through all of three array
Combine the arrays before the foreach loop
$comment_array = array_combine($get_id, $get_comment); $product_array = array_combine($get_id, $get_product); foreach ($product_array as $id => $product) { $comment = $comment_array[$id]; }