프로그램 개발서

JSON 결과 나오지 않을 때 본문

PHP

JSON 결과 나오지 않을 때

rairen 2022. 8. 31. 18:29

json_last_error() 확인

https://www.php.net/manual/en/function.json-last-error.php

 

PHP: json_last_error - Manual

use this code with mb_convert_encoding, you can json_encode some corrupt UTF-8 chars    function safe_json_encode($value, $options = 0, $depth = 512) {        $encoded = json_encode($value, $options, $depth);        if ($encoded === false && $val

www.php.net

json_last_error_msg() 확인

https://www.php.net/manual/en/function.json-last-error-msg.php

 

PHP: json_last_error_msg - Manual

Here's an updated version of the function: 'No error',                JSON_ERROR_DEPTH => 'Maximum stack depth exceeded',                JSON_ERROR_STATE_MISMATCH => 'State mismatch (invalid or malformed JSON)',                JSON_

www.php.net

 

php.net 에서 내용을 확인할 수 있다.

반응형

'PHP' 카테고리의 다른 글

[phpDocumentor]@abstract  (0) 2023.12.06
함수 모음  (0) 2023.06.29
usable_email : 사용가능한 이메일인지 확인  (0) 2022.08.21
[PHP] phpoffice spreadsheet 읽기  (0) 2021.09.02
[PHP] DISPLAY ERROR  (0) 2021.09.02