Answer the question
In order to leave comments, you need to log in
Why does the bool(FALSE) JSON error occur?
I'm trying to learn how to work with JSON, but I don't understand why an error occurs ... Here's the cad:
$jsonString = '
{
"payment_type": 1,
"address": {
"town_id": 1,
"street": "Яузская аллея",
"house_number": "2",
"underground": null,
"comment": "Яузская аллея, д. 21А",
"house_frame": "",
"flat_number": "",
"house_building": ""
}
}
';
$cart = json_encode($jsonString, TRUE);
print $cart->payment_type;
print var_dump($cart);
Answer the question
In order to leave comments, you need to log in
json_encode($jsonString, TRUE);
Well, you decode into an array, but you access it as an object
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question