When running this code on an Apache server, it returns results if the ID exists. On my Nginx/ISPConfig3 powered server, the same code returns NULL? I figured that there was something missing in the vhost, so I created a custom vhost master and added the following to location @php {}: default_type application/octet-stream;. I did a resync in ISPConfg3, checked the vhost of the site, saw that it was updated, but I am still getting a NULL result when I do var_dump($decode) even though the staffID exists.

I figured it out. The issue was having a number in the base url for $json_url (i.e. http://example.com/v1/staff/staffID/1/). I don't know why having "v1" in the url would cause issue on Nginx / ISPConfig3 but it does. Versioning an API is common practice.