PHP code example of hipsterjazzbo / editor

1. Go to this page and download the library: Download hipsterjazzbo/editor 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/ */

    

hipsterjazzbo / editor example snippets


echo Editor::create('hello world')->upperCase();

// HELLO WORLD

echo s('hello world')->upperCase();

// HELLO WORLD

echo s('    EDITOR is pretty neat I guess 💩      ')
    ->trim()
    ->titleCase();
    
// Editor is Pretty Neat I Guess 💩

$str = s('Apple');

echo $str->plural(); // Apples

echo $str; // Apple

$str = s('worlds');

echo 'Hello ' . $str->singular()->upperCaseFirst();

// Hello World

$hello = s('Hello World');

(string) $hello; // Will be a string

$hello->str(); // Will also be a string

s('this is a headline that will be properly title-cased')->titleCase();

// This Is a Headline That Will Be Properly Title-Cased

s('this is not actually title casing')->upperCaseFirst();

// This Is Not Actually Title-casing

s('apples')->singular(); // 'apple'

s('apple')->plural(); // 'apples'

// plural also has a $count parameter, in case you need to pluralize dynamically
s('apple')->plural($count); // 'apple' if $count is 1, 'apples' otherwise

s('bijou')->plural($count, 'fr'); // 'bijoux'