Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach ($result as $key => $value) {
- $arr_aux = array(
- 'element_id' => $value['element_id'],
- 'quality_review_id' => $value['review_id'],
- 'user_id' => $value['user_id'],
- 'date_created' => $value['date_created']
- );
- $arr_aux_params = array(
- 'type_param_id' => $value['type_param_id'],
- 'visible_name' => $value['visible_name'],
- 'value' => $value['value'],
- 'date_created' => $value['date_created'],
- 'user_id' => $value['created_user_id'],
- );
- $aux[] = $arr_aux_params;
- if (!empty($output)) {
- foreach ($output as $key2 => $value2) {
- if ($value['review_id'] == $value2['quality_review_id']) {
- $output[$key2]['params'] = array_merge($output[$key2]['params'], $aux);
- }else{
- $arr_aux['params'][] = $arr_aux_params;
- $output[] = $arr_aux;
- }
- }
- } else {
- if(!isset($arr_aux['params'])){
- $arr_aux['params'] = array();
- }
- $arr_aux['params'] = array_merge($arr_aux['params'], $aux);
- $output[] = $arr_aux;
- }
- $aux = array();
- file_put_contents("arr_aux.txt", print_r($arr_aux, true), FILE_APPEND);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement