Answer the question
In order to leave comments, you need to log in
Why is json_decode not executed if there is a question mark in the string?
Hello. Knowledgeable people, tell me on the topic of the question. On the site, the output is formed from a json string and everything works fine, but, for example, a string like {"link":" 123.ru "} is processed fine, but the string {"link":" 123.ru?a=1 "} everything kills. No matter how much I googled, no one complained about the question mark. How can this be won?
Answer the question
In order to leave comments, you need to log in
Nobody complains about the question mark because there is no problem with it, the following code works fine :
$json = '{"link":"123.ru?a=1"}';
$decoded = json_decode($json);
print_r($decoded);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question