php - Json_decode throws a null array when string contain "&" sign -
i have problem json_decode() when passed string contain "&". when mobile app send request post containing type of utf encoded string:
[ { "mobile": [ "123456" ], "full_name": [ "bride&groom" ] } json_decode() null array. happens when send request through mobile end. specific scenario? using laravel 5.
request taken $frienddetails = $request->friend pass variable through json_decode
$decodedfriend = json_decode($frienddetails ,true); as headers using oauth , header values this.
authorization bearer <token> content type application form data
thanks in advance
i tried json_decode function , string gave example decoded to:
object(stdclass)#1 (2) { ["mobile"]=> array(1) { [0]=> string(6) "123456" } ["full_name"]=> array(1) { [0]=> string(11) "bride&groom" } } consider adding mcve
Comments
Post a Comment