Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
a javascript like php string api
PHP
tree: bc815f5b99

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
String
tests
README.md
phpunit.xml

README.md

String

a javascript like php string api

why ?

  • string functions in php are a mess and hard to remember
  • every developpers know javascript
  • So the easiest way to work with strings in php is to work with a javascript string api like.

author M.PARAISO , Paris France

contact mparaiso@online.fr

Usage

require("String/String.php");
use String\String;
$string = new String("value");
echo $string; // echo the word value

Call string functions as instance methods or static methods

$string = new String("my string");
echo $string->indexOf("st"); // echo 3;
echo String::indexOf("my string","st"); // echo 3;

API

Implemented methods :

  • concat
  • indexOf
  • replace
  • search
  • slice
  • split
  • substr
  • substring
  • toLowerCase
  • toUpperCase
  • trim

static

TODO

  • write doc
  • implement the following api :
Something went wrong with that request. Please try again.