Help Parsing Data from API


#1

1) Give a description of the problem
I am having trouble parsing the data from this api, it seems to come back as HTML and json.

Anyone know how to parse this with $response?

<html>
    <body bgcolor="#000000" style="font-family: monospace;">
{"result": ["X", "Y", "Z"]}
        <br>
        <br>&nbsp;
        <font color="#00ffff">Test</font>
    </body>
</html>

Specifically I want to get teh values “X”, “Y”, and “Z”.


#2

Will result always have the same number of responses? You may need to look into the substring() function and remove all the rest

https://wiki.webcore.co/Functions#substring

You may also want to check the way you are calling the API as it may have other methods that provide the output cleaner (without hte HTML, but in JSON)


#3

Got it, thanks.