PHP Class Microweber\Utils\Format

Datei anzeigen Open project: microweber/microweber

Public Methods

Method Description
add_slashes_recursive ( $variable )
ago ( $time, $granularity = 2 )
array_to_base64 ( mixed $var ) : string Encodes a variable with json_encode and base64_encode.
array_to_ul ( array $arr, $ul_tag = 'ul', $li_tag = 'li' ) : string Prints an array in unordered list -
    .
array_trim ( $variable )
array_values ( $ary )
auto_link ( $text )
auto_link_text_callback ( $matches )
autolink ( $text ) http://stackoverflow.com/a/1971451/731166
base64_to_array ( string $var ) : string | array Decodes a variable with base64_decode and json_decode.
clean_html ( $var, $do_not_strip_tags = false )
clean_scripts ( $input )
clean_xss ( $var, $do_not_strip_tags = false )
date ( $date, boolean | string $date_format = false ) : boolean | string Formats a date by given pattern.
decode_ids ( $data )
decrypt ( $string )
encode_ids ( $data )
encrypt ( $string )
human_filesize ( $bytes, $dec = 2 )
is_base64 ( $data )
is_fqdn ( $FQDN )
limit ( $str, integer $n = 500, string $end_char = '…' ) : string Limits a string to a number of characters.
lipsum ( $number_of_characters = false )
lnotif ( $text, $class = 'success' )
no_dashes ( $string )
notif ( $text, $class = 'success' )
percent ( $num_amount, $num_total, $format = true )
prep_url ( $str = '' )
random_color ( )
render_item_custom_fields_data ( $item )
replace_once ( $needle, $replace, $haystack )
string_between ( $string, $start, $end )
strip_slashes_recursive ( $variable )
strip_unsafe ( $string, $img = false )
titlelize ( $string )
unvar_dump ( $str )

Method Details

add_slashes_recursive() public method

public add_slashes_recursive ( $variable )

ago() public method

public ago ( $time, $granularity = 2 )

array_to_base64() public method

Encodes a variable with json_encode and base64_encode.
public array_to_base64 ( mixed $var ) : string
$var mixed Your $var
return string Your encoded $var

array_to_ul() public method

Prints an array in unordered list -
    .
public array_to_ul ( array $arr, $ul_tag = 'ul', $li_tag = 'li' ) : string
$arr array
return string

array_trim() public method

public array_trim ( $variable )

array_values() public method

public array_values ( $ary )

base64_to_array() public method

Decodes a variable with base64_decode and json_decode.
public base64_to_array ( string $var ) : string | array
$var string Your var that has been put trough encode_var
return string | array Your encoded $var

clean_html() public method

public clean_html ( $var, $do_not_strip_tags = false )

clean_scripts() public method

public clean_scripts ( $input )

clean_xss() public method

public clean_xss ( $var, $do_not_strip_tags = false )

date() public method

Formats a date by given pattern.
public date ( $date, boolean | string $date_format = false ) : boolean | string
$date Your date
$date_format boolean | string The format for example 'Y-m-d'
return boolean | string $date The formatted date

decode_ids() public method

public decode_ids ( $data )

decrypt() public method

public decrypt ( $string )

encode_ids() public method

public encode_ids ( $data )

encrypt() public method

public encrypt ( $string )

human_filesize() public method

public human_filesize ( $bytes, $dec = 2 )

is_base64() public method

public is_base64 ( $data )

is_fqdn() public method

public is_fqdn ( $FQDN )

limit() public method

Limits a string to a number of characters.
public limit ( $str, integer $n = 500, string $end_char = '…' ) : string
$str
$n integer
$end_char string
return string

lipsum() public method

public lipsum ( $number_of_characters = false )

lnotif() public method

public lnotif ( $text, $class = 'success' )

no_dashes() public method

public no_dashes ( $string )

notif() public method

public notif ( $text, $class = 'success' )

percent() public method

public percent ( $num_amount, $num_total, $format = true )

prep_url() public method

public prep_url ( $str = '' )

random_color() public method

public random_color ( )

render_item_custom_fields_data() public method

replace_once() public method

public replace_once ( $needle, $replace, $haystack )

string_between() public method

public string_between ( $string, $start, $end )

strip_slashes_recursive() public method

public strip_slashes_recursive ( $variable )

strip_unsafe() public method

public strip_unsafe ( $string, $img = false )

titlelize() public method

public titlelize ( $string )

unvar_dump() public method

public unvar_dump ( $str )