issue when outputting an http:// address in a sub-array with json and php
Posted
by Patrick
on Stack Overflow
See other posts from Stack Overflow
or by Patrick
Published on 2010-06-14T23:55:47Z
Indexed on
2010/06/15
0:02 UTC
Read the original article
Hit count: 244
Im trying to achieve an output like this
{"status":"ok","0":{"id":"11","title":"digg","url":"http://www.digg.com"}}
but instead i am getting this
{"status":"ok","0":{"id":"11","title":"digg","url":"http:\/\/www.digg.com"}}
this is the php code im using to generate the json
$links = array('id'=>'11','title'=>'digg','url'=>"http://www.digg.com");
$msg = array('status'=>'ok',$links);
echo json_encode($msg);
any idea what is causing this?
© Stack Overflow or respective owner