Hi i need some help i have the following code
$producers = simplexml_import_dom($xmlDoc);
$file = fopen('producers.json','w');
foreach( $producers as $producer)
{
$info[] = $producer;
}
$jsonInfo = json_encode($info);
fwrite($file, $jsonInfo);
fclose($file);
this outputs
[{"id":"8","name":"Em\u00e5mejeriet","street":" Grenv\u00e4gen 1-3\n\t\t\t\t\t","postal":" 577 39\n\t\t\t\t\t","city":" Hultsfred\n\t\t\t\t","weburl":"http://www.emamejeriet.se","logourl":"http://172.16.206.1/~thajo/1DV449/laboration01/producenter/images/ema.png"},{"id":"57","name":"\u00d6lands \u00f6rtag\u00e5rd","street":" Stora Fr\u00f6 2393 \n\t\t\t\t\t","postal":" 380 62\n\t\t\t\t\t","city":" M\u00f6rbyl...and so on
I need som help to format it, i need to get rid of the newlines and format it to more readable json format. aswell I cannot get the UTF-8 to work.
/thanks