As of PHP 8.1, the Enum data type can be used to define exact enumeration values for a list. This is useful for cases where we know that the value of a variable can only take on a specific few values.
For example, this is how I store notification…
The Json data format was created to facilitate the transfer of structured data between client and server.
Converting an array or object to json
To convert an array or object to Json, there is a function json_encode in PHP:
$user = [
'name' => …