1. Go to this page and download the library: Download vendeka-nl/text 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/ */
vendeka-nl / text example snippets
use Vendeka\Text\Text;
Text::boot();
use Illuminate\Support\Str;
Str::of('taco')->enclose('[', ']')->upper(); //=> '[TACO]'
Str::unclose('/gift/', '/'); //=> 'gift'
Str::natural('my-first-blog'); //=> 'My first blog'
Str::natural('i_love_kebab'); // => 'I love kebab'
Str::normalizeWhitespace(" White\r\n space "); //=> 'White space'
Str::nullIfBlank(' '); //=> null
Str::nullIfEmpty(''); //=> null
Str::question('Questions'); //=> 'Questions?'
Str::sentence('this is a sentence'); //=> 'This is a sentence.'
Str::toParagraphs("Paragraph 1\n\nParagraph 2"); // => instance of Vendeka\Text\Paragraphs
use Vendeka\Text\Words;
(string) Str::toWords('a-dog'); //=> 'a dog'
Str::of('aSnake')->toWords()->of()->lower(); //=> 'a snake'
(string) (new Words(['From', 'an', 'array'])); //=> 'From an array'