Let's start with saying I'm a PHP . My goal is to process some data created by a PHP script, using JS.

Imagine my PHP script produces an array [1, 3, 7, 5]. I would like to use this array for making a chart. But somehow I don't understand how to make this data accessible for a JS script. Should I store it in a variable? If yes, how can I access it? Thanks a lot.