1. Go to this page and download the library: Download jasonlam604/stringizer 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/ */
jasonlam604 / stringizer example snippets
// Composer Autoloader
$s = new Stringizer("myapp");
$s->ensureRight("/");
// The following outputs: myapp/
echo $s->getString();
$s = new Stringizer("44GT44KT44Gr44Gh44Gv");
$s->base64Decode(); // こんにちは
$s = new Stringizer("ȘŦŗÍñĝìzĕŕ");
$s->base64Encode(); // yJjFpsWXw43DscSdw6x6xJXFlQ==
$s = new Stringizer("<div>ȘŦŗÍñĝìzĕŕ</div>");
$s->between("<div>", "</div>"); // ȘŦŗÍñĝìzĕŕ
$s = new Stringizer("data_rate");
$s->camelize(); // dataRate
$s = new Stringizer("helloSŦŗÍñĝìzĕŕ");
$s->camelToSnake(); // hello_sŦŗÍñĝìzĕŕ
$s = new Stringizer("Foo Bar Fizz Buzz");
$s->charAt(4); // B
$s = new Stringizer("ȘŦŗÍñĝìzĕŕ");
$s->chars(); // an array made up 10 indexes ["Ș","Ŧ","ŗ","Í","ñ","ĝ","ì","z","ĕ","ŕ"]
$s = new Stringizer("ȘŦŗÍñĝìzĕŕ");
$s->charAt(1); // Ŧ
$s = new Stringizer("ȘŦŗÍñĝìzĕŕ");
$s->charAt(0); // S
$s = new Stringizer("ȘŦŗÍñĝìzĕŕ");
$s->chompLeft("ȘŦŗÍñĝ"); // ìzĕŕ
$s = new Stringizer("ȘŦŗÍñĝìzĕŕ");
$s->chompRight("ìzĕŕ"); // ȘŦŗÍñĝ
$s = new Stringizer("ȘŦŗÍñĝìzĕŕ");
$s->chopLeft("ȘŦŗÍñĝ"); // ìzĕŕ
$s = new Stringizer("ȘŦŗÍñĝìzĕŕ");
$s->chopRight("ìzĕŕ"); // ȘŦŗÍñĝ
$s = new Stringizer(""ȘŦŗÍñĝ\n\nìzĕŕ \n\t \r"");
$s->concat("collapseWhitespace") // ȘŦŗÍñĝ ìzĕŕ
$s = new Stringizer("fizz");
$s->concat(" buzz") // fizz buzz
$s = new Stringizer(" buzz");
$s->concat("fizz",true) // fizz buzz
$s = new Stringizer("fizz buzz foo bar");
$s->contains("buzz"); // true
$s = new Stringizer("fizz buzz foo bar");
$s->contains("Buzz"); // false, case sensitive
$s = new Stringizer("fizz buzz foo bar");
$s->containsIncaseSensitive("Buzz"); // true, case insensitive
$s = new Stringizer("dataRate");
$s->dasherize(); // data-rate
$s = new Stringizer("Fizz 列Fizz列 Fizz");
$s->delete("列"); //Fizz Fizz Fizz
$s = new Stringizer("Fizz Buzz");
$s->endsWith("zz"); // true
$s = new Stringizer("文字列のそれ");
$s->endsWith("れ"); // true
$s = new Stringizer("文字列のそれ");
$s->endsWith("れれれれ"); // false
$s = new Stringizer("/myapp");
$s->ensureLeft("/"); // /myapp
$s = new Stringizer("/myapp");
$s->ensureRight("/"); // /myapp/
$s = new Stringizer("ȘŦŗÍñĝìzĕŕ");
$s->first(6); // ȘŦŗÍñĝ
$s = new Stringizer("Hello, World");
$s->hashCode(); // -505841268
$s = new Stringizer("stŗiñĝìzĕŕ");
$s->hasLowercase()); // true
$s = new Stringizer("sTŗiñĝìzĕŕ");
$s->hasLowercase()); // false
$s = new Stringizer("STÃÑ");
$s->hasUppercase()); // true
$s = new Stringizer("StÃÑ");
$s->hasUppercase()); // false
$s = new Stringizer("Fizz Buzz Foo Bar");
$s->indexOf("Foo"); // 10
$s = new Stringizer("Fizz Buzz Foo Bar");
$s->indexOf("bad"); // false
$s = new Stringizer("Foo Buzz Foo Bar");
$s->indexOf("Foo", 0); // 0, since offset starts at zero the first Foo is found at index 0
$s->indexOf("Foo", 1); // 9, since offset is past zero the next available match is at index 9
$s = new Stringizer("fòô bàř");
$s->indexOf("bàř"); // 4
$s = new Stringizer("Fizz Buzz Foo Bar");
$s->indexOfCaseInsensitive("foo"); // 10
$s = new Stringizer("abcdefghi....12334567890....ABC..XY!!!@#$%^&*()_+=-<>?:;/.,~][}{\|'");
$s->isAscii(); // true
$s = new Stringizer("\x19test\x7F");
$s->isAscii(); // true
$s->isAscii(true); // false
$s = new Stringizer("FooBar");
$s->isAlpha(); // true
$s = new Stringizer("Foo Bar");
$s->isAlpha(); // false
$s = new Stringizer("F00Bar");
$s->isAlphaNumeric(); // true
$s = new Stringizer("F00 Bar");
$s->isAlphaNumeric(); // false
$s = new Stringizer("F00 Bar");
$s->isAlphaNumericSpace(); // true
$s = new Stringizer("F00 Bar !");
$s->isAlphaNumericSpace(); // false
$s = new Stringizer("Marie-Anne Lucy");
$s->isAlphaNumericSpaceDash(); // true
$s = new Stringizer("Marie-Ann Lucy!");
$s->isAlphaNumericSpaceDash(); // false
// Decoded value is ȘŦŗÍñĝìzĕŕ
$s = new Stringizer("yJjFpsWXw43DscSdw6x6xJXFlQ==");
$s->isBase64(); // true
$s = new Stringizer("\n \n\r\t ");
$s->isBlank(); // true
date_default_timezone_set('America/Vancouver');
$s = new Stringizer("2015-03-15");
$s->isDate(); // true
date_default_timezone_set('America/Vancouver');
$s = new Stringizer("January 1st");
$s->isDate(); // true
$s = new Stringizer("19.99");
$s->isDecimal(); // true
$s = new Stringizer("19");
$s->isDecimal(); // true
$s = new Stringizer("19x");
$s->isDecimal(); // false
php
$s = new Stringizer("mood");
$s->reverse(); // doom
php
$s = new Stringizer("文字列のそれ");
$s->reverse(); // れその列字文
php
$s = new Stringizer("ȘŦŗÍñĝìzĕŕ jumped over the stringy stick. ȘŦŗÍñĝìzĕŕ jumped over the stringy stick again! Or did it?");
$s->sentenceCount(); // 3