PHP code example of jstewmc / expand-abbreviations

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

    

jstewmc / expand-abbreviations example snippets


namespace Jstewmc\ExpandAbbreviations;

// define replacements (i.e., replace "foo" with "bar")
$replacements = ['foo' => 'bar'];

// instantiate service
$service = new ExpandAbbreviations($replacements);

// expand abbreviations
$service('foo bar baz');   // returns "bar bar baz"
$service('foo. bar baz');  // returns "bar bar baz"
$service('qux');           // returns "qux"