Skip to content

hyperia-sk/yii2-string-helpers

Repository files navigation

Yii2 string helpers

GitHub license

Extension for Yii2 string helpers

Installation

The preferred way to install this extension is through composer.

Either run

composer require hyperia/yii2-string-helpers:"^1.0"

or add

"hyperia/yii2-string-helpers": "^1.0"

to the require section of your composer.json.

Available Methods

  • contains
  • isLonger
  • isShorter
  • length
  • toLower
  • toUpper
  • firstCharToUpper
  • removeAccent

Usage

use hyperia\helpers\StringHelper;

echo StringHelper::isLonger('This is test string', 12); // 1
echo StrinhHelper::removeAccent('Ħí ŧħə®ë, юßť å test!'); // Hi there, jusst a test!
echo StringHelper::contains('is', 'This is test string'); // 1

Tests

./vendor/bin/phpunit