Amiro.CMS API Reference
Amiro.Ru / Manual
Loading search...

The AMI_Lib_String class

• Introduction

String library.

• Class synopsis

AMI_Lib_String {
/* Methods */
// Returns file size in text mode.
public static getBytesAsText ( int $size, $aLocale, [ int $precision = 0 ], [ int $forcePower = -1 ], [ string $zeroVal = '0' ], [ string $thousandsDelim = ' ' ] ) returns string;
// Converts all applicable characters to HTML entities.
public static htmlChars ( string $string ) returns string;
// Checks the URL is full.
public static isFullLink ( string $url ) returns bool;
// Strips HTML and PHP tags from a string including script/style inner text.
public static stripTags ( string $string ) returns string;
// Truncates string.
public static truncate ( string $string, int $length, [ bool $isSpecial = false ], [ bool $bSaveWords = false ], [ string $tail = '...' ] ) returns string;
public hex2Bin ( mixed $hex, [ mixed $isRev = true ], string $entity ) returns void;
}
Tags:
since 5.12.0

• Class Methods

// Returns file size in text mode.
public static getBytesAsText ( int $size, $aLocale, [ int $precision = 0 ], [ int $forcePower = -1 ], [ string $zeroVal = '0' ], [ string $thousandsDelim = ' ' ] ) returns string;
  • int $size
    Size to be translated as text
  • array $aLocale
    Locale array
  • int $precision
    Number of digits after comma
  • int $forcePower
    Force result power (-1 no force power)
  • string $zeroVal
    Format of returning zero value
  • string $thousandsDelim
    Thouthands delimiter
Tags:
since 5.14.0
// Converts all applicable characters to HTML entities.
public static htmlChars ( string $string ) returns string;
  • string $string
    String
  • string $url
    URL
Tags:
since 5.14.4
// Strips HTML and PHP tags from a string including script/style inner text.
public static stripTags ( string $string ) returns string;
  • string $string
    String
// Truncates string.
public static truncate ( string $string, int $length, [ bool $isSpecial = false ], [ bool $bSaveWords = false ], [ string $tail = '...' ] ) returns string;
  • string $string
    String
  • int $length
    Max length
  • bool $isSpecial
    Process as htmlspecialchars() result
  • bool $bSaveWords
    Save whole words
  • string $tail
    Append tail if truncated
public hex2Bin ( mixed $hex, [ mixed $isRev = true ], string $entity ) returns void;
  • string $entity