/environment/functions/general.php

Description
Functions
array_flat (line 179)

Flattens the array. This function does not preserve keys, it just returns array indexed form 0 .. count - 1

  • access: public
array array_flat (array $array)
  • array $array: If this value is not array it will be returned as one
array_stripslashes (line 402)

This function will walk recursivly thorugh array and strip slashes from scalar values

null array_stripslashes ( &$array, array $array)
  • array $array
  • &$array
array_var (line 127)

Return variable from hash (associative array). If value does not exists return default value

  • access: public
mixed array_var ( &$from, string $name, [mixed $default = null], array $from)
  • array $from: Hash
  • string $name
  • mixed $default
  • &$from
clean (line 72)

Equivalent to htmlspecialchars(), but allows &#[0-9]+ (for unicode)

This function was taken from punBB codebase <http://www.punbb.org/>

string clean (string $str)
  • string $str
clean_var_info (line 37)

This function will return clean variable info

null clean_var_info (mixed $var, [string $indent = '&amp;nbsp;&amp;nbsp;'], [string $indent_close_bracet = ''])
  • mixed $var
  • string $indent: Indent is used when dumping arrays recursivly
  • string $indent_close_bracet: Indent close bracket param is used internaly for array output. It is shorter that var indent for 2 spaces
fix_input_quotes (line 388)

This function will strip slashes if magic quotes is enabled so all input data ($_GET, $_POST, $_COOKIE) is free of slashes

  • access: public
null fix_input_quotes ([void 0 = ])
  • void 0
get_id (line 158)

This function will return ID from array variables. Default settings will get 'id' variable from $_GET. If ID is not found function will return NULL

integer get_id ([string $var_name = 'id'], [array $from = null], [mixed $default = null])
  • string $var_name: Variable name. Default is 'id'
  • array $from: Extract ID from this array. If NULL $_GET will be used
  • mixed $default: Default value is returned in case of any error
get_max_upload_size (line 345)

This function will return max upload size in bytes

integer get_max_upload_size ([void 0 = ])
  • void 0
get_referer (line 335)

Return referer URL

string get_referer ([string $default = null])
  • string $default: This value is returned if referer is not found or is empty
instance_of (line 11)

Check if $object is valid $class instance

  • access: public
null instance_of (mixed $object, string $class)
  • mixed $object: Variable that need to be checked agains classname
  • string $class: Classname
is_valid_email (line 275)

Check if selected email has valid email format

boolean is_valid_email (string $user_email)
  • string $user_email: Email address
is_valid_function_name (line 97)

This function will return true if $str is valid function name (made out of alpha numeric characters + underscore)

boolean is_valid_function_name (string $str)
  • string $str
is_valid_hash (line 113)

Check if specific string is valid sha1() hash

boolean is_valid_hash (string $hash)
  • string $hash
is_valid_url (line 291)

Verify the syntax of the given URL.

  • access: public
boolean is_valid_url ($url $url)
  • $url $url: The URL to verify.
php_config_value_to_bytes (line 360)

Convert PHP config value (2M, 8M, 200K...) to bytes

This function was taken from PHP documentation

integer php_config_value_to_bytes (string $val)
  • string $val
pre_var_dump (line 22)

Show var dump. pre_var_dump() is used for testing only!

  • access: public
null pre_var_dump (mixed $var)
  • mixed $var
redirect_to (line 304)

Redirect to specific URL (header redirection)

  • access: public
void redirect_to (string $to, [boolean $die = true])
  • string $to: Redirect to this URL
  • boolean $die: Die when finished
redirect_to_referer (line 320)

Redirect to referer

  • access: public
null redirect_to_referer ([string $alternative = nulls])
  • string $alternative: Alternative URL is used if referer is not valid URL
string_to_array (line 138)

This function will return $str as an array

array string_to_array (string $str)
  • string $str
str_ends_with (line 245)

String ends with something

This function will return true only if input string ends with niddle

boolean str_ends_with (string $string, string $niddle)
  • string $string: Input string
  • string $niddle: Needle string
str_replace_first (line 212)

Replace first $search_for with $replace_with in $in. If $search_for is not found original $in string will be returned...

  • access: public
string str_replace_first (string $search_for, string $replace_with, string $in)
  • string $search_for: Search for this string
  • string $replace_with: Replace it with this value
  • string $in: Haystack
str_starts_with (line 231)

String starts with something

This function will return true only if input string starts with niddle

boolean str_starts_with (string $string, string $niddle)
  • string $string: Input string
  • string $niddle: Needle string
undo_htmlspecialchars (line 85)

Convert entities back to valid characteds

string undo_htmlspecialchars (string $escaped_string)
  • string $escaped_string
without_slash (line 265)

Remove trailing slash from the end of the path (if exists)

string without_slash (string $path)
  • string $path: File path that need to be handled
with_slash (line 255)

Return path with trailing slash

  • return: Path with trailing slash
string with_slash (string $path)
  • string $path: Input path

Documentation generated on Wed, 23 Jan 2008 01:58:44 +0000 by phpDocumentor 1.4.0