i try with success when combine 2 array into one foreach loop ..
<?php
//var
$phone_prefix_array = $_POST['phone_prefix']; //prefix eg. 60 (for country code)
$phone_num_array = $_POST['phone'];
$c_name_array = $_POST['customer_name'];
foreach (array_combine($phone_prefix_array, $phone_num_array) as $phone_prefix => $phone_num) { //combine prefix array and phone number array
$phone_var = $phone_prefix . $phone_num;
$phone = '6' . $phone_var;
if ($phone_prefix == true && $phone_num == true) { //filter if no prefix number dont show
echo $phone;
//customer_name_here
} else {
}
}
?>
The result should be like this :
60125487541 Jake
60355485541 Kane
60315488745 Ray
63222522125 Josh
but now im not sure how to combine another array $c_name_array into foreach lopp
PHP version : 5.2.17
forloop?