I want to receive multiple array in php like 3 array data . here is my html code
i want to receive three multiple array data using php
Example : id : 05 , star : 03 , review : test Example : id : 09 , star : 05 , review : test new
Array date : star[] , review[] , cast_id[]
Data Recive : $star , $review , $cast_id
<select class="form-control" name="star[]" required>
<option value="">Please Select</option>
<option value="1">1</option>
<option value="2">2 </option>
<option value="3">3 </option>
<option value="4">4 </option>
<option value="5">5</option>
</select>
<textarea class="form-control" rows="5" id="review[]" name="review[]</textarea>
<input name="cast_id[]" id="cast_id[]" type="hidden" value="<?php echo $cast_id; ?>">
Here I tried to receive the multiple array data and print but I only get the first array data so how can I get all data values
foreach($_POST['cast_id'] as $cast_id) {
foreach (array_combine($_POST['star'], $_POST['review']) as $star => $review) {
echo $cast_id."<br>";
echo $star."<br>";
echo $review."<br>";
//$reg_action = mysqli_query($con, "UPDATE job_apply_review SET star = '$star', review = '$review' WHERE cast_id = '$cast_id'");
}
}
thank you
array_combineon your fields? And it's not clear at all what you're trying to do here