2017 © Pedro Peláez
 

library string4

String4 is a PHP class that provides methods for string manipulation. This package is part of the ATK14 Framework.

image

atk14/string4

String4 is a PHP class that provides methods for string manipulation. This package is part of the ATK14 Framework.

  • Wednesday, May 23, 2018
  • by yarri
  • Repository
  • 2 Watchers
  • 0 Stars
  • 1,054 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 105 % Grown

The README.md

String4

String4 is a PHP class that provides methods for string manipulation. This package is part of the ATK14 Framework., (*1)

Basic usage

$s = new String4("Hello There!");

echo $s->lower(); // "hello there!"
echo $s->upper(); // "HELLO THERE!"
echo $s->length(); // 12
print_r($s->chars()); // ["H","e","l","l","o"," ","T","h","e","r","e","!"]
echo $s->replace("Hello","Hi"); // "Hi There!"
echo $s->gsub('/[^a-z]/i','_');  // "Hello_There_"
echo $s->at(1); // "e"
echo $s->substr(0,5); // "Hello"
var_dump($s->contains("Hello")); // true
var_dump($s->containsOneOf("Hi","Ciao","Hey")); // false

Random strings & passwords

Method String4::RandomString() generates string of the given length composed of random characters taken from the set [a-zA-Z0-9]., (*2)

echo String4::RandomString(10); // "7VGlhe3EzR"

// extra characters can also be specified
echo String4::RandomString(["length" => 15, "extra_chars" => "#!&@"]); // "@vIxpVo!qD4A#n5"

Method String4::RandomPassword() generates random string from a smaller set of characters than String4::RandomString(). Some characters which can cause a confusion are excluded, e.g. "1","l","O","0"., (*3)

echo String4::RandomPassword(12); // 68ynedeSA634

String4::RandomPassword() can be also used as a voucher codes generator:, (*4)

echo String4::RandomPassword(10)->upper(); // EVUH923244

Installation

Use the Composer to install String4., (*5)

cd path/to/your/project/
composer require atk14/string4

Licence

String4 is free software distributed under the terms of the MIT license, (*6)

The Versions

23/05 2018

dev-master

9999999-dev https://github.com/atk14/Http

String4 is a PHP class that provides methods for string manipulation. This package is part of the ATK14 Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

string

16/02 2018

v0.1.1

0.1.1.0 https://github.com/atk14/Http

String4 is a PHP class that provides methods for string manipulation. This package is part of the ATK14 Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

string

30/11 2017

v0.1

0.1.0.0 https://github.com/atk14/Http

String4 is a PHP class that provides methods for string manipulation. This package is part of the ATK14 Framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

string