Trying to get a php variable which contains json format to a Javascript file using getJson

I have a php file that contains a variable in which it stores json format string via jsonEncode.
Ex. $store = json_encode($bigArray);

I am trying to access $store in a javascript using

var test = "<?php echo $store; ?>";
$.getJSON('url',test, function(data){
}

However, I am not able to get it and I get a 404 error.