Link to home
Start Free TrialLog in
Avatar of Alex Lord
Alex Lord

asked on

looping thought to output array not working

The data

User generated image

the source of data

$jrArr[$jrID] = array (
				  'id'=>$jrID,
				  'date'=>$getJourney['Date'],
				  'name'=>$getJourney['name'],
				  'info'=> empty($info) ? $getJourney['jrEvent'] : $info,
				  'step'=>$step
				);

Open in new window


	
		$response = array(
			'Result' => 'getJrDetails success',
			'jr' => $jrArr,
			'jrCount' => $jrCount
		);

Open in new window



my effort


for(i = 0; i < response.jr.length; i++){


                      var d = new Date(parseInt(response.jr['date'])*1000);
                                    var day = String(d.getDate());
                                    if(day.length == 1)
                                    {
                                        day = "0"+day;
                                    }
                                    var month = String(d.getMonth()+1);
                                    if(month.length == 1)
                                    {
                                        month = "0"+month;
                                    }
                                    var year = d.getFullYear();


                     html = html + '<tr id="jr-'+response.jr[i]['id']+'" name="'+response.jr[i]['id']+'">'
                              + '<td>'+day+'-'+month+'-'+year+'</td>'
                              + ' <td>'+response.jr[i]['name']+'</td>'
                              + '<td>'+response.jr[i]['step']+'</td>'
                              + '<td>'+response.jr[i]['info']+'</td>'
                              + '</tr>';
                 }

Open in new window


result is none lol so not sure.
ASKER CERTIFIED SOLUTION
Avatar of Alex Lord
Alex Lord

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial