|
Procedural File: Functions.php
Source Location: Program_Root/Functions.php
Classes:
Page Details:
This is a list of functions aimed at improving something about existing PHP functions, and which are used in places in the Sitellite Application Framework.
CASE_LOWER [line 414]
CASE_UPPER [line 409]
array_change_key_case [line 425]
array array_change_key_case(
array $array, [int $changeCase = CASE_LOWER])
|
|
Returns an array with all string keys lowercased or uppercased
Tags:
Parameters
| array |
$array |
array to change keys |
| int |
$changeCase |
how to transform keys |
array_chunk [line 372]
void array_chunk(
mixed $input, mixed $size, [mixed $preserve_keys = false])
|
|
Provides array_chunk() for PHP 4.1 users.
Tags:
array_chunk_fill [line 456]
array array_chunk_fill(
array $list, integer $chunk, [boolean $assoc = false], [mixed $fill = ' '])
|
|
Calls array_chunk(), but adds a parameter $fill, which "fills out" the potentially uneven number if items in the last array with the value of $fill.
Tags:
Parameters
| array |
$list |
|
| integer |
$chunk |
|
| boolean |
$assoc |
|
| mixed |
$fill |
|
array_search [line 277]
mixed array_search(
[mixed $needle = ''], [array $haystack = ''])
|
|
If the PHP version is less than 4.0.5, emulates the array_search() function.
Tags:
Parameters
| mixed |
$needle |
|
| array |
$haystack |
|
assocify [line 358]
array assocify(
array $arr)
|
|
Turns a regular array into an associative array with a $value => $value new key/value relation. For example, an array [1=>Joe,2=>Jane,3=>Joe] would become [Joe=>Joe,Jane=>Jane]. Please note the loss of duplicate values.
Tags:
Parameters
better_crypt [line 183]
string better_crypt(
string $pass, [string $salt = ''])
|
|
Makes sure that the salt is always two characters in length before sending it to the crypt() function. Also generates its own two character salt if none is provided.
Tags:
Parameters
| string |
$pass |
|
| string |
$salt |
|
better_crypt_compare [line 203]
boolean better_crypt_compare(
string $pass, string $original)
|
|
Calls the better_crypt() function instead of crypt() when comparing a new password to the original to see if it matches up.
Tags:
Parameters
| string |
$pass |
|
| string |
$original |
|
better_strrpos [line 651]
int better_strrpos(
string $haystack, string $needle)
|
|
strrpos() which allows multiple characters in the needle.
Tags:
Parameters
| string |
$haystack |
|
| string |
$needle |
|
commify [line 315]
string commify(
[string $number = ""])
|
|
Adds commas every three numbers from the right of the period to a given number.
Tags:
Parameters
format_filesize [line 295]
string format_filesize(
[integer $size = 0])
|
|
Returns a file size formatted in a more human-friendly format, rounded to the nearest Gb, Mb, Kb, or byte.
Tags:
Parameters
htmlentities_compat [line 55]
string htmlentities_compat(
string $val1, [string $val2 = ENT_COMPAT], [string $val3 = 'iso-8859-1'])
|
|
Where htmlentities() causes corruption of data in alternate character sets, this function aims to translate the necessary entities without damaging the data. Currently does a str_replace for the following entities: - '&' * => '&'
- '<' * => '&lt;'
- '>' * => '&gt;'
- '<' * * => '<'
- '>' * * => '>'
- '"' * * => '"'
It also does an extra preg_replace for & followed by a space/tab/cr/lf and replaces the & with a &.
Tags:
Parameters
| string |
$val1 |
|
| string |
$val2 |
|
| string |
$val3 |
|
htmlentities_reverse [line 85]
string htmlentities_reverse(
string $val1)
|
|
Reverses the htmlentities_compat() function exactly.
Tags:
Parameters
html_marker [line 259]
string html_marker(
string $note)
|
|
Creates an HTML comment padded with dashes for easily marking sections of a document. Hnady for viewing the source of large documents.
Tags:
Parameters
info [line 330]
void info(
mixed $value, [boolean $full = false])
|
|
Wraps a print_r() or var_dump() of the given $value with a set of tags around it, and echoes it.
Tags:
Parameters
| mixed |
$value |
|
| boolean |
$full |
|
is_a [line 239]
boolean is_a(
string $class, string $match)
|
|
If the PHP version is less than 4.2.0, emulates the is_a() function, which determines whether the object, $class, is of the class specified by $match.
Tags:
Parameters
| string |
$class |
|
| string |
$match |
|
is_assoc [line 601]
boolean is_assoc(
mixed $arr)
|
|
Determines whether the specified variable is an associative array.
Tags:
Parameters
localdate [line 683]
string localdate(
string $format, [int $unixdate = ''])
|
|
A date() replacement which respects your setlocale() setting. From php.net/date comments, user "isp dot phptime at spsoft dot de"
Tags:
Parameters
| string |
$format |
|
| int |
$unixdate |
|
make_assoc [line 140]
array make_assoc(
array $array, [string $key = ''], [string $value = ''])
|
|
Creates a single-level associative array out of an array of objects or an array of associative arrays. $key and $value specify the property or array key name to use for their respective values in the new associative array.
Tags:
Parameters
| array |
$array |
|
| string |
$key |
|
| string |
$value |
|
make_obj [line 124]
object &make_obj(
array $array)
|
|
Note: Deprecated in favour of a simple: $obj = (object) $array; Creates an object out of a hash (or any other type). There is no make_hash() function because that can simply be cast as well ($array = (array) $obj). Thanks to Demian Turner for pointing out this equivalence.
Tags:
Parameters
mime [line 514]
string mime(
string $file)
|
|
Determines the content type of a file based on a small list of common types. Useful when mime_content_type() isn't available or isn't configured correctly.
Tags:
Parameters
mime_content_type [line 589]
void mime_content_type(
mixed $file)
|
|
readfile_chunked [line 720]
int readfile_chunked(
string $filename, [boolean $retbytes = true])
|
|
Replacement for readfile() in PHP5 which doesn't encounter memory limits.
Tags:
Parameters
| string |
$filename |
|
| boolean |
$retbytes |
|
sql_split [line 623]
array sql_split(
string $sql)
|
|
Splits an SQL script into distinct queries which can be evaluated or manipulated individually.
Tags:
Parameters
vsprintf [line 222]
string vsprintf(
string $str, array $args)
|
|
If the PHP version is less than 4.1.0, emulates the vsprintf() function using a call_user_func_array() with the sprintf() function. The use of this function in the saf.I18n package was causing fatal errors in Sitellite on earlier PHP versions.
Tags:
Parameters
xmlentities [line 476]
string xmlentities(
string $string, [string $quote_style = ENT_COMPAT])
|
|
Converts entities to unicode entities (ie. < becomes <). From php.net/htmlentities comments, user "webwurst at web dot de"
Tags:
Parameters
| string |
$string |
|
| string |
$quote_style |
|
xmlentities_reverse [line 494]
string xmlentities_reverse(
string $string)
|
|
Converts XML unicode entities back to their original characters (ie. < becomes <).
Tags:
Parameters
|