Y
Y
YakovSpb2020-06-04 17:29:16
PHP
YakovSpb, 2020-06-04 17:29:16

When converting an object to json, brackets are escaped, how to remove it?

$data_str = json_encode($data, JSON_UNESCAPED_UNICODE);

{"url":"your-site.ru\/kontakty\/"}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2020-06-04
@YakovSpb

The brackets here are only curly and they are not escaped.
If you are talking about slashes, then JSON_UNESCAPED_SLASHES .

S
Sodikjon Karimov, 2020-06-04
@SodikjonKarimov

$row['url'] = mb_convert_encoding($tmprow['url'], "UTF-8", "auto");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question