I'm getting null when I decode my Json. $contactInfo is a String from Java(Android) pushed via Volley. I did check the string, it is a string.
I have tried the following
1) Make the $contactInfo with one user's contact only
2) Removed spaces
3) Remove special characters like ♡
4) Remove +
The closest solution I can find to reading such [[data,data],[data,data]] is to use json decode. Is there any other way for me to read this into a array or json?
$contactInfo = "[[john qiu, +16266169643], [Vince, +65 5888 8447]]"
$obj = stripslashes($contactInfo);
$obj = json_decode($obj);
echo json_last_error();
echo is returning JSON_ERROR_SYNTAX
contactInfo, for some users , there are special characters like "♡"
The correct JSON format is
$contactInfo = '[["john qiu", 16266169643], ["Vince", 6558888447]]"
You can validate your output, to see if its right on some website like this one for example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With