mysql - How to access nested data in php -
i write sql procedure showing given output.how access data in php using foreach loop ?
array ( [0] => array ( [0] => array ( [vehical_profile_id] => 1 [chasis_number] => 123 [vehicle_engine_number] => a123 [rto_regis_number] => a123 [model_number] => a123 [vehicle_color] => red [vehicle_production_year_month] => june 2012 [owner_first_name] => avinash [owner_middle_name] => prakash [owner_last_name] => dhanke [owner_father_name] => prakash dhanke [owner_gender] => male [owner_blood_group] => ab+ [owner_dob] => 1990-07-07 [entity_address] => wadi [entity_local_area] => navneet nagar [entity_city] => nagpur [entity_state] => mh [entity_country] => india [entity_pincode] => 440023 [mobile] => 973044444 [landline] => [email] => prajakta@gmail.com [vehicle_service_profile_id] => 1 [vehicle_id] => 1 [vehicle_service_in_date] => 2014-11-19 [vehicle_service_out_date] => 0000-00-00 [vehicle_service_status] => not done [vehicle_service_job_card_no] => job123 [vehicle_service_receipt_no] => r123 [vehicle_service_total_cost] => 5000 ) ) [1] => array ( [0] => array ( [vehicle_service_details_id] => 1 [vehicle_service_profile_id] => 1 [vehicle_service_work_code] => oilchange [vehicle_service_work_status] => not done [vehicle_service_work_cost] => 5000 ) [1] => array ( [vehicle_service_details_id] => 2 [vehicle_service_profile_id] => 1 [vehicle_service_work_code] => breakshoes [vehicle_service_work_status] => not done [vehicle_service_work_cost] => 2000 ) [2] => array ( [vehicle_service_details_id] => 3 [vehicle_service_profile_id] => 1 [vehicle_service_work_code] => headlight [vehicle_service_work_status] => not done [vehicle_service_work_cost] => 1000 ) ) )
$finalarray=array(); foreach($array $valuearrayone){ foreach($valuearrayone $valuearraytwo){ // valuearraytwowill 3rd nested array, how can access need take care of nesting $finalarray[]= $valuearraytwo; <--- can assign array final array , can iterate on } } print_r($finalarray);
i hope work smoothly.
Comments
Post a Comment