how to get local characters inside json array

user7461846
<head>
<meta charset="UTF-8">
</head> 

I'm trying to use JSON between javascript, php and mysql.

<?php

$str = "ČAŠA***ĆAO***ŽILET***DOGAĐAJ";

$arr = explode('***', $str);

$jsonarr = json_encode($arr);

echo $jsonarr . "<br><br>";

$phparr = json_decode($jsonarr);

print_r($phparr);

Result:

["\u010cA\u0160A","\u0106AO","\u017dILET","DOGA\u0110AJ"]

Array ( [0] => ČAŠA [1] => ĆAO [2] => ŽILET [3] => DOGAĐAJ )

Is there a way to get this:

["ČAŠA","ĆAO","ŽILET","DOGAĐAJ"]

Or maybe so great JSON is only english speaking?

Hassaan

Add JSON_UNESCAPED_UNICODE flag to json_encode

Replace

$jsonarr = json_encode($arr);

with

$jsonarr = json_encode($arr, JSON_UNESCAPED_UNICODE);

here is list of json_encode constants

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How to get related items by id inside of json integer array column in MySQL

分類Dev

How to split a JSON array inside an object

分類Dev

How to get the size of an element inside an array?

分類Dev

How to get all values of objects inside array

分類Dev

How to create Array inside array for return json_encode($data)

分類Dev

MongoDB. How to update json property inside an array

分類Dev

How do I parse an array inside parsed JSON in Swift?

分類Dev

How to get the number of elements in a JSON array?

分類Dev

Get a local json file on NativeScript

分類Dev

How to read lines of a text file with specific word to an array and get the first four characters of the last line in that array?

分類Dev

How to get json value from json array using javascript

分類Dev

jQuery - How to get JSON array name from nested JSON

分類Dev

How to access the array inside the array

分類Dev

Accessing an array inside an array in json response

分類Dev

How do I parse a JSON which contains an array inside a json Object without a arrayName

分類Dev

Discord API, can not get data from json array inside array from user input arg[1] in Node JS

分類Dev

How to parse json to get all values of a specific key within an array?

分類Dev

How do I get data from JSON Array MSSQL

分類Dev

How to parse JSON array from a GET request in react-native?

分類Dev

How to get the information from JSON array into list and into XAML

分類Dev

how to get a particular object value from nested json array

分類Dev

How to get JSON response array all index values?

分類Dev

How get data from array in json item using angularjs

分類Dev

Python - obtain JSON from URL, control and special characters inside

分類Dev

How to test if pointer inside an array?

分類Dev

Get nested data from local JSON file

分類Dev

Consume a nested array inside JSON request in Go

分類Dev

JSON accessing multiple instances inside of an array

分類Dev

Parsing JSON Object inside Array in Jackson

Related 関連記事

  1. 1

    How to get related items by id inside of json integer array column in MySQL

  2. 2

    How to split a JSON array inside an object

  3. 3

    How to get the size of an element inside an array?

  4. 4

    How to get all values of objects inside array

  5. 5

    How to create Array inside array for return json_encode($data)

  6. 6

    MongoDB. How to update json property inside an array

  7. 7

    How do I parse an array inside parsed JSON in Swift?

  8. 8

    How to get the number of elements in a JSON array?

  9. 9

    Get a local json file on NativeScript

  10. 10

    How to read lines of a text file with specific word to an array and get the first four characters of the last line in that array?

  11. 11

    How to get json value from json array using javascript

  12. 12

    jQuery - How to get JSON array name from nested JSON

  13. 13

    How to access the array inside the array

  14. 14

    Accessing an array inside an array in json response

  15. 15

    How do I parse a JSON which contains an array inside a json Object without a arrayName

  16. 16

    Discord API, can not get data from json array inside array from user input arg[1] in Node JS

  17. 17

    How to parse json to get all values of a specific key within an array?

  18. 18

    How do I get data from JSON Array MSSQL

  19. 19

    How to parse JSON array from a GET request in react-native?

  20. 20

    How to get the information from JSON array into list and into XAML

  21. 21

    how to get a particular object value from nested json array

  22. 22

    How to get JSON response array all index values?

  23. 23

    How get data from array in json item using angularjs

  24. 24

    Python - obtain JSON from URL, control and special characters inside

  25. 25

    How to test if pointer inside an array?

  26. 26

    Get nested data from local JSON file

  27. 27

    Consume a nested array inside JSON request in Go

  28. 28

    JSON accessing multiple instances inside of an array

  29. 29

    Parsing JSON Object inside Array in Jackson

ホットタグ

アーカイブ