Utilities
in package
Class with useful functions.
Table of Contents
- CAPTCHA = 'abcdefghjkmnpqrstuvwxyz23456789'
- CODE = 'abcdefghijklmnopqrstuvwxyz01234567890'
- ID = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890'
- Possible chars for:
- checkFileName() : mixed
- Checks if a String is a valid file-name (file only, no dirs)
- optimizeOutputString() : mixed
- Does some optimizing on the give string to output it for html display nl2br and htmlentities
- randomCode() : mixed
- Generates a random code
- validateInput() : the
- Validates a string by the given rex and cuts lenght **no boolean return**
Constants
CAPTCHA
public
mixed
CAPTCHA
= 'abcdefghjkmnpqrstuvwxyz23456789'
CODE
public
mixed
CODE
= 'abcdefghijklmnopqrstuvwxyz01234567890'
ID
Possible chars for:
public
mixed
ID
= 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890'
Methods
checkFileName()
Checks if a String is a valid file-name (file only, no dirs)
public
static checkFileName( $name) : mixed
Parameters
Return values
mixed —optimizeOutputString()
Does some optimizing on the give string to output it for html display nl2br and htmlentities
public
static optimizeOutputString( $cont) : mixed
Parameters
Return values
mixed —randomCode()
Generates a random code
public
static randomCode( $len, $chars) : mixed
Parameters
Return values
mixed —validateInput()
Validates a string by the given rex and cuts lenght **no boolean return**
public
static validateInput( $s, $reg, $len) : the
Parameters
- $s :
-
the string to check
- $reg :
-
the regular expressions (/[^a-z]/ to allow only small latin letters)
- $len :
-
the maximum lenght
Return values
the —clean string (empty, if other input than string or only dirty characters)