PHP code example of angelkurten / string

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

    

angelkurten / string example snippets



  e AngelKurten\String\String;
  
  $str = new String('If :PARAM is :BOOLEAN increases :TIME');
  
  $array = [':PARAM' => 'cut', ':BOOLEAN' => 'TRUE', ':TIME' => '<b>partially</b>'];
  
  echo  $str->replace($array)->concat('the value of X in 30');
 
  echo $str->length();

  echo $str->invert();

  echo $str->upper();

  echo $str->lower();

  echo $str->upWords();

  echo $str->upFirst();

  echo $str->fragment(75, '<br/>', true);

  $array = [':PARAM' => 'X', ':BOOLEAN' => 'TRUE', ':TIME' => 'parcialmente'];
  echo  $str->replace($array);

  echo  $str->partial(0, 10);

  echo  $str->toArray();

  echo  $str->hash('enter key here');

  echo  $str->HtmlToString();

  echo  $str->StringToHtml();

  echo  $str->concat('the value of X in 30');

  echo  $str->concat('the value of X in :VALUE')->upper()->replace([':VALUE' => '100']);