使用json_encode为javascript var重新格式化json

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;

1) You can't get it to use the ' ', as the specification for valid-JSON requires " ", so any program expecting to parse your string from JSON to an object in JS/PHP/etc, is going to error out on you

2) Why? JS doesn't care which one you use, one way or another, and if you're doing something on the server-side, leave it as a multi-dimensional (potentially associative) array.

3) If it's for the purpose of including " " inside of your actual string, then escape them with \, like so:

$myString = "This is my \"double-quoted\" string";

$myString === 'This is my "double-quoted" string';
$myString === "This is my " . '"double-quoted"' . "string";

If you are concatenating strings together, and one of those strings already contains double-quotes within the string itself, then your language will automatically ensure they're escaped.

I'd be happy to help further, but I'd need to know the "Why?" part.