wintercounter
wintercounter

Reputation: 7468

json_encode character issue

I'm having a strange issue with json_encode.

Doing this:

echo json_encode(array('action' => 'act'));

Returns this:

"\u0000\"action\":\"act\"}

Yes, without starting bracket. How to solve this?

Upvotes: 0

Views: 103

Answers (2)

wintercounter
wintercounter

Reputation: 7468

The problem was that json_encode was running twice.

Upvotes: 0

mohammad mohsenipur
mohammad mohsenipur

Reputation: 3149

I haven't This Problem Output is

 {"action":"act"}

Upvotes: 1

Related Questions