cbor_decode.php
Table of Contents
Functions
- cbor_decode() : mixed
- Decodes a CBOR binary string into a PHP normalized structure (array, scalar, etc.).
Functions
cbor_decode()
Decodes a CBOR binary string into a PHP normalized structure (array, scalar, etc.).
cbor_decode(string $data[, Closure|null $replacer = null ]) : mixed
This function will attempt to decode CBOR data. If decoding fails due to invalid
CBOR content, a RuntimeException will be thrown with an HTTP-style code:
422(Unprocessable Entity) if the CBOR data is invalid or malformed500(Internal Server Error) for unexpected failures
Parameters
- $data : string
-
The binary CBOR data
- $replacer : Closure|null = null
-
Optional callback applied to each decoded value: fn($key, $value)
Tags
Return values
mixed —The decoded PHP data (array, int, string, etc.)