PHP Class Pop\Filter\String

Author: Nick Sagona, III ([email protected])
Afficher le fichier Open project: nicksagona/PopPHP Class Usage Examples

Méthodes publiques

Méthode Description
between ( string $string, integer $start, integer $end ) : string Method to return a substring of the string between two delimiters.
camelCaseToDash ( string $string ) : string Method to convert the string from camelCase to dash format
camelCaseToSeparator ( string $string, string $sep = DIRECTORY_SEPARATOR ) : string Method to convert the string from camelCase to separator format
camelCaseToUnderscore ( string $string ) : string Method to convert the string from camelCase to under_score format
clean ( string $string, boolean $html = false ) : string Method to clean the string of any of the standard MS Word based characters and return the newly edited string
dashToCamelcase ( string $string ) : string Method to convert the string from dash to camelCase format
dashToSeparator ( string $string, string $sep = DIRECTORY_SEPARATOR ) : string Method to convert the string from dash to separator format
dashToUnderscore ( string $string ) : string Method to convert the string from dash to under_score format
dosToUnix ( string $string ) : string Method to convert newlines from DOS to UNIX
escape ( string $string, boolean $all = false ) : string Method to simulate escaping a string for DB entry, much like mysql_real_escape_string(), but without requiring a DB connection.
links ( string $string, boolean $target = false ) : string Method to convert any links in the string to clickable HTML links.
random ( integer $length, integer $type = String::ALL, integer $case = String::MIXED ) : string Method to generate a random alphanumeric string of a predefined length.
slug ( string $string, string $sep = null ) : string Method to convert the string into an SEO-friendly slug.
underscoreToCamelcase ( string $string ) : string Method to convert the string from under_score to camelCase format
underscoreToDash ( string $string ) : string Method to convert the string from under_score to dash format
underscoreToSeparator ( string $string, string $sep = DIRECTORY_SEPARATOR ) : string Method to convert the string from under_score to separator format
unixToDos ( string $string ) : string Method to convert newlines from UNIX to DOS

Méthodes protégées

Méthode Description
convertCamelCase ( string $string, string $sep ) : string Method to convert a camelCase string using the $sep value passed

Method Details

between() public static méthode

Method to return a substring of the string between two delimiters.
public static between ( string $string, integer $start, integer $end ) : string
$string string
$start integer
$end integer
Résultat string

camelCaseToDash() public static méthode

Method to convert the string from camelCase to dash format
public static camelCaseToDash ( string $string ) : string
$string string
Résultat string

camelCaseToSeparator() public static méthode

Method to convert the string from camelCase to separator format
public static camelCaseToSeparator ( string $string, string $sep = DIRECTORY_SEPARATOR ) : string
$string string
$sep string
Résultat string

camelCaseToUnderscore() public static méthode

Method to convert the string from camelCase to under_score format
public static camelCaseToUnderscore ( string $string ) : string
$string string
Résultat string

clean() public static méthode

Method to clean the string of any of the standard MS Word based characters and return the newly edited string
public static clean ( string $string, boolean $html = false ) : string
$string string
$html boolean
Résultat string

convertCamelCase() protected static méthode

Method to convert a camelCase string using the $sep value passed
protected static convertCamelCase ( string $string, string $sep ) : string
$string string
$sep string
Résultat string

dashToCamelcase() public static méthode

Method to convert the string from dash to camelCase format
public static dashToCamelcase ( string $string ) : string
$string string
Résultat string

dashToSeparator() public static méthode

Method to convert the string from dash to separator format
public static dashToSeparator ( string $string, string $sep = DIRECTORY_SEPARATOR ) : string
$string string
$sep string
Résultat string

dashToUnderscore() public static méthode

Method to convert the string from dash to under_score format
public static dashToUnderscore ( string $string ) : string
$string string
Résultat string

dosToUnix() public static méthode

Method to convert newlines from DOS to UNIX
public static dosToUnix ( string $string ) : string
$string string
Résultat string

escape() public static méthode

The parameter $all is boolean flag that, when set to true, causes the '%' and '_' characters to be escaped as well.
public static escape ( string $string, boolean $all = false ) : string
$string string
$all boolean
Résultat string

random() public static méthode

Method to generate a random alphanumeric string of a predefined length.
public static random ( integer $length, integer $type = String::ALL, integer $case = String::MIXED ) : string
$length integer
$type integer
$case integer
Résultat string

slug() public static méthode

Method to convert the string into an SEO-friendly slug.
public static slug ( string $string, string $sep = null ) : string
$string string
$sep string
Résultat string

underscoreToCamelcase() public static méthode

Method to convert the string from under_score to camelCase format
public static underscoreToCamelcase ( string $string ) : string
$string string
Résultat string

underscoreToDash() public static méthode

Method to convert the string from under_score to dash format
public static underscoreToDash ( string $string ) : string
$string string
Résultat string

underscoreToSeparator() public static méthode

Method to convert the string from under_score to separator format
public static underscoreToSeparator ( string $string, string $sep = DIRECTORY_SEPARATOR ) : string
$string string
$sep string
Résultat string

unixToDos() public static méthode

Method to convert newlines from UNIX to DOS
public static unixToDos ( string $string ) : string
$string string
Résultat string