PHP code example of lyte / serial
1. Go to this page and download the library: Download lyte/serial library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lyte / serial example snippets
use Lyte\Serial\Serial;
// unserialize statically
$unserialized = Serial::unserialize($someSerializedString);
// or with an instance
$serial = new Serial;
$unserialized = $serial->unserialize($someSerializedString);
// check if a string appears to be serialized
if (Serial::isSerialized($someUnknownString)) {
$unserialized = Serial::unserialize($someUnknownString);
}
// or rely on exceptions
try {
$unserialized = Serial::unserialize($someUnknownString);
} catch (\Exception $e) {
// ...
}
use Lyte\Serial\Unserializer;
$serial = new Unserializer($someSerializedString);
$unserialized = $serial->unserialize();