How to add linebreak to decoded json array in php

rima

New Member
I need to add some sort of line break after each segment (date, name, address, phone) to separate them, I have tried using the break and paragraph etc but just keep on getting syntax errors with the usual unexpected "<" and have also tried using tables but that failed too.Is there an easy way to format the output of this to display each part on a separate line please?\[code\]<?php $file = file_get_contents('http://somesite.com/Data/jsontxt'); $out = (json_decode($file)); echo $out->date; echo $out->name; echo $out->address; echo $out->phone;?>\[/code\]This is a sample of the array:\[code\]{"name":"Joe Bloggs","date":"11:58pm 28 August 2010","address":"13 Boggy Ave, Hamilton","phone":"555-5478"}\[/code\]and what I am currently getting:Joe Bloggs11:58pm 28 August 201013 Boggy Ave, Hamilton555-5478
 
Back
Top