How can i get information from this array

nitiphone2021

New member
Dear All,

How can I get information that return from this array by loop to get all information.
the information is from database query and it has 2 rows information

Code:
Array ( [0] => Array ( [id] => 5 [t_test_date] => 2021-02-11 [t_test_number] => 1 [t_uid] => 202102110001 [t_test_type] => 1 [t_status_id] => 4 [t_test_result_pcr] => 1 [t_test_result_rdt] => 0 [t_test_time] => 2021-02-11 11:39:00 [t_report_date] => [p_first_name] => tesdt [p_last_name] => tesdt [p_gender] => 0 [p_nationality] => [p_date_birth] => [p_passport_no] => [p_personal_id] => [p_issue_country] => [p_date_expiry] => [phone] => [email] => [t_price] => 0 [p_valid] => 1 [created_date] => 2021-02-11 [modified_date] => 2021-02-11 11:40:18 [t_status_type] => ຂັ້ນຕອນທີ່ 4. ອອກການຢັ້ງຢືນ [t_status_typeEng] => Stage 4. Certificate Issued [t_status] => 4. ຢັ້ງຢືນແລ້ວ [t_statusEng] => 4. Issued [test_time] => 11/02/2021 11:39 ) [1] => Array ( [id] => 7 [t_test_date] => 2021-02-11 [t_test_number] => 3 [t_uid] => 202102110003 [t_test_type] => 2 [t_status_id] => 4 [t_test_result_pcr] => 1 [t_test_result_rdt] => 1 [t_test_time] => 2021-02-11 18:38:00 [t_report_date] => [p_first_name] => Hhh [p_last_name] => Tttt [p_gender] => 0 [p_nationality] => [p_date_birth] => [p_passport_no] => [p_personal_id] => [p_issue_country] => [p_date_expiry] => [phone] => [email] => [t_price] => 0 [p_valid] => 1 [created_date] => 2021-02-11 [modified_date] => 2021-02-11 18:38:51 [t_status_type] => ຂັ້ນຕອນທີ່ 4. ອອກການຢັ້ງຢືນ [t_status_typeEng] => Stage 4. Certificate Issued [t_status] => 4. ຢັ້ງຢືນແລ້ວ [t_statusEng] => 4. Issued [test_time] => 11/02/2021 18:38 ) );
 
Code:
foreach ($records as $record) {
    echo $record['id'] . "<br>"; // An so on 
}

Though I would do
Code:
echo "<pre>" . print_r($theArray, 1) . "</pre>";
first to see how the array is really setup.
 
Back
Top