spatie/crawler - php скрипт для обхода ссылок на сайте
Crawler::create()
->setCrawlObserver(<class that extends \Spatie\Crawler\CrawlObserver>)
->startCrawling($url);
https://github.com/spatie/crawler
Crawler::create()
->setCrawlObserver(<class that extends \Spatie\Crawler\CrawlObserver>)
->startCrawling($url);
$string = new Twine\Str('john pinkerton');
$string->substring(5, 4); // Returns 'pink'
$string = new Twine\Str('john pinkerton');
$string->truncate(12); // Returns 'john pink...'
$string->truncate(10, '~'); // Returns 'john pink~'
$string->truncate(8); // Returns 'john...'
И много других методов$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() }}" />
Категории:
Оставить на заметку в: