Overview

Namespaces

  • Deimos
    • Helper
      • Exceptions
      • Helpers
        • Arr
        • Str
      • Traits
  • PHP

Classes

  • Str

Traits

  • DefaultTrait
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Class Str

Deimos\Helper\AbstractHelper implements Deimos\Helper\InterfaceHelper
Extended by Deimos\Helper\Helpers\Str\Str uses Deimos\Helper\Helpers\Str\DefaultTrait
Namespace: Deimos\Helper\Helpers\Str
Located at Helper/Helpers/Str/Str.php
Methods summary
public string
# shorten( string $str, integer $length = 100, string $end = '…' )

Shortens text to length and keeps integrity of words

Shortens text to length and keeps integrity of words

Parameters

$str
$length
$end

Returns

string
public string
# ucFirst( string $string )

Parameters

$string

Returns

string
public string
# lcFirst( string $string )

Parameters

$string

Returns

string
public string
# random( integer $length = 32, integer $type = Deimos\Helper\Helpers\Str\Str::RAND_ALL )

Return random string

Return random string

Parameters

$length
$type

Returns

string

Throws

InvalidArgumentException
protected string
# rand( string $chars, integer $length )

Parameters

$chars
$length

Returns

string
public string
# uniqid( )

Returns

string
public float
# fileSize( integer $size, integer $decimals = 2 )

Parameters

$size
$decimals

Returns

float
public string
# translit( $string )

transliteration cyr->lat

transliteration cyr->lat

Parameters

$string

Returns

string
Methods inherited from Deimos\Helper\AbstractHelper
__construct()
Methods used from Deimos\Helper\Helpers\Str\DefaultTrait
capitalize(), len(), low(), pos(), repeat(), shuffle(), sub(), toNumber(), upp()
Constants summary
string DIGITS
# '0123456789'
string ALPHABET_LOW
# 'abcdefghijklmnopqrstuvwxyz'
string ALPHABET_HIGH
# 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
string ALPHABET
# 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
integer RAND_ALPHA_LOW
# 1
integer RAND_ALPHA_HIGH
# 2
integer RAND_ALPHA
# 4
integer RAND_DIGITS
# 8
integer RAND_ALL
# 16
Properties summary
protected array $dictionary
# [ 4 => self::ALPHABET . self::DIGITS, 3 => self::DIGITS, 2 => self::ALPHABET, 1 => self::ALPHABET_HIGH, 0 => self::ALPHABET_LOW, ]
Properties inherited from Deimos\Helper\AbstractHelper
$helper
API documentation generated by ApiGen