There is a string
$data_string = '{ "persistent_menu":[ { "locale":"default", "composer_input_disabled": false, "call_to_actions":[ { "title":"Замовити документи", "type":"nested", "call_to_actions":[ { "title":"Документ", "type":"postback", "payload":"in_developing" }, { "title":"Документ", "type":"postback", "payload":"in_developing" }, { "title":"Документ", "type":"postback", "payload":"in_developing" } ] }, { "title":"Взаємодія з сайтом", "type":"nested", "call_to_actions":[ { "title":"Пошук в ЄДРСР", "type":"postback", "payload" : "search_edrsr" }, { "title":"Статус замовлення", "type":"postback", "payload" : "status_order" }, { "title":"Авторизація", "type":"postback", "payload" : "authorization" }, ] }, { "title":"Оцінити бота", "type":"postback", "payload" : "rate_bot" } ] } ] }'; CURL:
$ch = curl_init($url); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data_string)) ); $result = curl_exec($ch); curl_close($ch); Comes only:
{"persistent_menu": [{"locale": "default", "composer_input_disabled": false, "call_to_actions": [{"title": "Note the document", "type": "nested", "call_to_actions": [{ "title": "Document", "type": "postback", "payload": "in_developing"}, {"title": "Document", "type": "postback", "payload": "in_developing"} , {"title": "Document", "type": "postback", "payload": "in_developing"}]}, {"title": "Link to site", "type": "nested", "call_to_actions ": [{" title ":" Link to ЄDRSP "," type ":" postback "," payload ":" search_edrsr "}, {" title ":" Postback status "," type ":" postback "," payload ":" status_order "}, {" title ":" Authorization "," type ":" postback "," payload ":" authorization "},]}, {" title ":
Where does the rest of the string go? If the line "Cyrillic" is replaced by "Latin" - then the whole line comes.
mb_strlentry. - teran