Alright, I’ve got a very unique API for a service I run, in which the return values are displayed similarly to JSON (but not JSON), and it works very well with most languages, but now I face a problem accessing the returned values using Javascript only.
I have a PHP page which takes GET parameters, and then displays output like this:
stapi=0,0,0,0,0,0,0,0&stlinks=Hu3L|http://www.example.com,3Ozq|https://www.example.com
That is the only output of the webpage, and what I’d like to do is collect these two variables into a Javascript Array to be displayed as a list. (The second variable I typically collect into matched pairs as you can see the separation with the “|“)
Now I just need to know how to collect the “variables” from the output and put them into an array (these two pages are NOT going to be on the same server)
…
**I want to put the stapi comma-separated values into its own array
and then the stlinks vertical-bar matched pairs/comma separated values into its own array
Try this function to split your string with this pipe:
What You need is packed to result variable.