M
M
Mitya ToDaSyo2018-12-17 21:13:19
PHP
Mitya ToDaSyo, 2018-12-17 21:13:19

How to deal with php warning about using utf-8?

When using php, it swears at the utf-8 constant, saying that support will stop in the next version
json_encode($array, utf-8);

Warning: Use of undefined constant utf - assumed 'utf' (this will throw an Error in a future version of PHP)

How to solve this moment? Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-12-17
@dimastik1986

Options are passed as the second parameter. So I have the same question as php, what does the string "utf-8" do there, besides not being escaped?
Docks: php.net/manual/ru/function.json-encode.php
List of available constants: php.net/manual/ru/json.constants.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question