How can i grab data from this php page?
Hi guy's is it possible using php simply grab data from a php page?
The php page looks like this...
Code:
{
"id": "1486966978"
},
{
"id": "1497131620"
},
{
"installed": true,
"id": "1509660136"
},
{
"installed": true,
"id": "1529210112"
},
{
"id": "1569558425"
},
{
what i want to do is make my php page check that page and only grab the ID's where it says installed:true and then echo them...
(only want it to grab the numbers, if the page displays no installed:true, then it will display a message, saying no friends installed...
Is this possible?
Thanks
Jamie
Re: How can i grab data from this php page?
Looks like a JSON string. Maybe you could use the decode function: http://www.php.net/manual/en/function.json-decode.php
:wave:
Re: How can i grab data from this php page?
Hi mate, what i am doing instead is getting the ID's from a xml document instead,
The document looks like this...
<uid>1509660136</uid>
<uid>1529210112</uid>
my php code is simply -
Code:
<?php
$sxe = simplexml_load_file('path to xml');
echo "$sxe->uid";
?>
which works, however its only echoing the first uid like 1509660136.
how can i change the code to echo each <uid> in the document, rather than just one?
Thanks
Jami
Re: How can i grab data from this php page?
Try this:
PHP Code:
<?php
$sxe = simplexml_load_file('path to xml');
foreach($sxe->uid as $id)
{
echo $id;
}
?>
:wave: