Send json array in post request php

The problem your having is this string is NOT Proper JSON: [500,'hello world']

this would be proper JSON [500,"hello world"]. JSON is very strict on formatting and requires that all string values be wrapped in double quotes and NEVER single quotes.

the proper thing to do to avoid problems, would be to use the php functions json_encode[] and json_decode[]

for example,



    

Chủ Đề