tebru/gson-php - php скрипт преобразует object в json и обратно
$gson = Gson::builder()->build();
$jsonArray = $gson->toArray($object);
$object = $gson->fromArray($jsonArray);
https://github.com/tebru/gson-php
$gson = Gson::builder()->build();
$jsonArray = $gson->toArray($object);
$object = $gson->fromArray($jsonArray);
function findLast($items, $func)
{
$filteredItems = array_filter($items, $func);
return array_pop($filteredItems);
}
//this will output data-uri (base64 image data)
//something like data:image/png;base64,iVBORw0KGg....
Avatar::create('Joko Widodo')->toBase64();
//use in view
//this will display initials JW as an image
<img src="{{ Avatar::create('Joko Widodo')->toBase64() }}" />
Категории:
Оставить на заметку в: