i am able to read a json file into an array and display the output but i want to use that array directly to give it as a input to another php function to plot a graph,

how to read json file into a php array and plot a graph by using this array ?

```
       <?php
         $string = file_get_contents("json.json");
       $example_data=json_decode($string,true);

       foreach ($example_data as $k => $v) {
        echo $k, ' : ', $v;
        }
        ?>

```

but instead of displaying it as an output text, i want to give this example\_data as an input array to another php function,

in the above code, instead of declaring the example\_data, i want to read it from another json file as i did in the first code, can anyone give me a solution to this ?