 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Aniblaze Grandmaster Cheater Supreme
Reputation: 138
Joined: 23 Apr 2006 Posts: 1757 Location: The Netherlands
|
Posted: Fri Aug 21, 2015 5:07 pm Post subject: |
|
|
| HackOtaku wrote: | oh, lol, I named $item as an array, then as the return object.
I changed it to $itemAr, but the issue is that
$itemAr[$j] = $item["name"];
when I attempt that, it tells me "name" is an illegal string offset, even though I can see the data in front of me. |
It looks like the API you're talking to returns the data in JSON format. You'd need to use json_decode() first, and then use it as an object (e.g. $data->name).
EDIT: Also might I recommend installing and using xdebug on your dev machine? using print_r() or var_dump() is making it unnecessarily difficult for you to debug your code.
|
|
| Back to top |
|
 |
HackOtaku I posted the 500000th topic
Reputation: 81
Joined: 31 May 2007 Posts: 228
|
Posted: Fri Aug 21, 2015 6:21 pm Post subject: |
|
|
| Aniblaze wrote: | | HackOtaku wrote: | oh, lol, I named $item as an array, then as the return object.
I changed it to $itemAr, but the issue is that
$itemAr[$j] = $item["name"];
when I attempt that, it tells me "name" is an illegal string offset, even though I can see the data in front of me. |
It looks like the API you're talking to returns the data in JSON format. You'd need to use json_decode() first, and then use it as an object (e.g. $data->name).
EDIT: Also might I recommend installing and using xdebug on your dev machine? using print_r() or var_dump() is making it unnecessarily difficult for you to debug your code. |
ding ding. This solved everything and it all works now, thanks! And I will definitely be using xdebug in future php works.
Unfortunately, the person I am working with decided he doesn't much like php, and wants to do it all in javascript instead, lol.
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Fri Aug 21, 2015 10:21 pm Post subject: |
|
|
If you move to nodejs you'll enjoy it. It is a very nice toolset to work with.
_________________
- Retired. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|