# PHP Service not returning json

**URL:** <https://community.dreamfactory.com/t/php-service-not-returning-json/4767>\
**Category:** Server-Side Scripting\
**Created:** [January 16, 2019, 11:58am UTC](https://community.dreamfactory.com/t/php-service-not-returning-json/4767 "2019-01-16T11:58:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fwu](https://avatars.discourse-cdn.com/v4/letter/f/dbc845/32.png) [@fwu](https://community.dreamfactory.com/u/fwu)\
**Post date:** [January 16, 2019, 11:58am UTC](https://community.dreamfactory.com/t/php-service-not-returning-json/4767/1 "2019-01-16T11:58:00Z")

</div>

hello,

I create a PHP service. Im returning an array as a json object using json\_encode($object). The response message says Content-tpy: application/json. I guess this is being added to the response by dreamfactory. Howver, the client application actuall gets a string like this: “$object\_value”. So there are ‘"’ envolving the json value which makes it a text/string and not a json object.

Can someone tell me why this happens? How can I deliver a json object instead of a string?

regards

---

<div class="post-metadata">

**Author:** ![fwu](https://avatars.discourse-cdn.com/v4/letter/f/dbc845/32.png) [@fwu](https://community.dreamfactory.com/u/fwu)\
**Post date:** [January 16, 2019, 12:16pm UTC](https://community.dreamfactory.com/t/php-service-not-returning-json/4767/2 "2019-01-16T12:16:00Z")

</div>

I think this is a bug in dreamfactory: if the client set the header like this:

Accept: application/json

The client will get a string and not a json object. So I beeive dreamfactory is making a json\_decode of my response which is already a json object… Can someone confirm this?

regards
