Why JSON adds extra spaces and line?

0 like 0 dislike
104 views
There is an array in PHP. Convert it to JSON as follows:
json_encode($array, JSON_UNESCAPED_UNICODE);
In the end, the data are generated correctly, but added a lot of unnecessary characters at the beginning and end of rows. For example, a newline (\) and a lot of spaces before and after. The link that was originally kind of https://yandex.ru/ turns into https:\\/\\/yandex.ru\\. Is it possible to perform the conversion without adding extra data?
by | 104 views

1 Answer

0 like 0 dislike
by

Related questions

0 like 0 dislike
1 answer
asked Sep 2, 2019 by respirant
0 like 0 dislike
1 answer
asked Jul 7, 2019 by respirant
0 like 0 dislike
1 answer
asked Jul 8, 2019 by respirant
0 like 0 dislike
1 answer
asked Jun 14, 2019 by respirant
0 like 0 dislike
1 answer
asked May 12, 2019 by JackBoner
110,608 questions
257,187 answers
0 comments
40,796 users