I want to get data from the URL in the form of JSON and store in the variable of PHP. after it I want to call PHP variables in JS and show by console.log().
your query is not clear. if you want to use php array variable in javascript and to console you can get idea from this,
<?php
$p= array("foo", "bar", "baz");
?>
<script type="text/javascript">
let app = <?php echo json_encode($p); ?>;
console.log(app);
</script>