I should send Hi" to a Yahoo server, so in PHP I should place \ befor the ", but it will get bad JSON arguments. How should I do it?
Place Hi" in JSON code without error?
$message = "Hi\"";
$postdata = '{
"message" : "'.$message.'"
}';
Use
json_encodeinstead of hand-crafting JSON:If you must handcraft your JSON, don’t forget to add a backslash before a quotation mark: