PHP json_encode返回null?

时间:2016-11-22 11:36:21

标签: php json

我有一个像下面这样的字符串。但是json_encode函数返回null。因为它包含这样的内容:

先生。布朗(ketaptin \ xc3 \ xa7al \ xc4)

原文: 先生。布朗(ketaptinçalışanı)

我该如何解决这个问题?我应该使用哪种功能?

我的阵列:

      [success] => 1\n    [message] => \n    
[error_code] => -1\n    
[data] => Array\n        (\n            
   [contact_subjects] => Array\n                (\n                    [0] => Array\n                        (\n                                   
   [contact_subject_id] => 1\n                            [name] => \xc3\x96neri\n                        )\n\n                    [1] => Array\n                        (\n                            [contact_subject_id] => 2\n                              [name] => Soru\n                        )\n\n                    [2] => Array\n                        (\n                            [contact_subject_id] => 3\n                            [name] => \xc3\x96deme Bilgisi\n                        )\n\n                    [3] => Array\n                        (\n                            [contact_subject_id] => 4\n                            [name] => \xc5\x9eikayet\n                        )\n\n                    [4] => Array\n                        (\n                            [contact_subject_id] => 5\n                            [name] => Ortakl\xc4\xb1k\n                        )\n\n                    [5] => Array\n                        (\n                            [contact_subject_id] => 6\n                            [name] => Arad\xc4\xb1m Bulamad\xc4\xb1m\n                        )\n\n                    [6] => Array\n                        (\n                            [contact_subject_id] => 7\n                            [name] => E-Kitap\n                        )\n\n                    [7] => Array\n                        (\n                            [contact_subject_id] => 8\n                            [name] => Mobil Uygulamalar\n                        )\n\n                    [8] => Array\n                        (\n                            [contact_subject_id] => 9\n                            [name] => Reklam\n                        )\n\n                )\n\n            [customer_name] => Mr. Brown (ketaptin \xc3\xa7al\xc4\n            [customer_email] => hrev@hotmail.com\n        )\n\n)\n 

对不起代码。你可以从这里美化它:http://phillihp.com/toolz/php-array-beautifier/

0 个答案:

没有答案