Hi this is the code i am following in my project.
$reports = $this->curl->simple_get('url');
echo is_array($reports)?"Is Array":"Not Array";exit;
It's giving Not Array
as output.
I want to convert that into associative array.
Hi this is the code i am following in my project.
$reports = $this->curl->simple_get('url');
echo is_array($reports)?"Is Array":"Not Array";exit;
It's giving Not Array
as output.
I want to convert that into associative array.
The data you are getting is probably not an array, but a string containing an array structure, e.g. output by print_r(). This kind of data will not automatically be converted back into a PHP array.
To use this you can use a similar solution as brought out here: Create variable from print_r output
it describes the print_r_reverse
function that's brought out in php.net page.
how ever - this is kind of an ugly hack. I would suggest to change the page content and use json_encode()
in the "url" page, and parse the content using json_decode()