PHP 클래스 Ouzo\Utilities\Json

파일 보기 프로젝트 열기: letsdrink/ouzo 1 사용 예제들

공개 메소드들

메소드 설명
decode ( string $string, boolean $asArray = false ) : mixed Decodes a JSON string, or throws JsonDecodeException on failure
encode ( array | JsonSerializable $value ) : string Returns the JSON representation of the $value
lastError ( ) : integer Returns a JSON error code for the last operation.
safeDecode ( string $string, boolean $asArray = false ) : mixed Decodes a JSON string

비공개 메소드들

메소드 설명
lastErrorMessage ( )

메소드 상세

decode() 공개 정적인 메소드

Decodes a JSON string, or throws JsonDecodeException on failure
public static decode ( string $string, boolean $asArray = false ) : mixed
$string string
$asArray boolean
리턴 mixed

encode() 공개 정적인 메소드

Returns the JSON representation of the $value
public static encode ( array | JsonSerializable $value ) : string
$value array | JsonSerializable
리턴 string

lastError() 공개 정적인 메소드

Returns a JSON error code for the last operation.
public static lastError ( ) : integer
리턴 integer

safeDecode() 공개 정적인 메소드

Decodes a JSON string
public static safeDecode ( string $string, boolean $asArray = false ) : mixed
$string string
$asArray boolean
리턴 mixed