quick question i really need some help, i re-formatting some json to get it into a javascript var, i got it working with json_encode but i need it to output ' symbol instead of the " symbol, is there a way to do that
i need it to be like this (using the ' symbol)
{
title:'Greeting',
mp3:'http://www.godsgypsychristianchurch.net/music/Atlanta%20GA/Dey%20duma%20amensa/01%20Greeting.mp3',
buy:'http://www.godsgypsychristianchurch.net/music/Atlanta%20GA/Dey%20duma%20amensa/01%20Greeting.mp3',
price:'Download',
duration:'',
cover:'http://godsgypsychristianchurch.net/music_artwork/DEFAULT_COVER.png'},
My Code:
foreach ($json['rows'] as $row) {
if ($_GET['churchname'] == $row[doc]['album']) {
$songCount = 0;
foreach ($row['doc']['tracks'] as $song) {
++$songCount;
$arr = array(
"title" => "{$song['name']}",
"mp3" => "{$songUrl}",
"buy" => "{$songUrl}",
"price" => "Download",
"duration" => "",
"cover" => "{$row['doc']['artwork']}",
);
echo json_encode($arr);
}
}
}
exit;
json_encode()
for double quotes and replace them with single quotes? – Lorax Nov 13 '12 at 20:09