Freeder
 All Classes Files Functions Variables Pages
Functions
functions.php File Reference

Various functions, not specific and widely used. More...

Functions

 multiarray_search ($field, $value, $array, $default_value=false)
 
 multiarray_filter ($field, $value, $array)
 
 startswith ($haystack, $needle)
 
 endswith ($haystack, $needle)
 
 list_templates ()
 
 get_generation_time ($start_generation_time)
 

Detailed Description

Various functions, not specific and widely used.

Freeder

Function Documentation

endswith (   $haystack,
  $needle 
)

Check that $haystack ends with $needle.

get_generation_time (   $start_generation_time)

Get the total generation time.

Parameters
$start_generation_timeis a milliseconds timestamp
Returns
Generation time as a string, with units (seconds or milliseconds)
list_templates ( )

List all available templates.

Returns
An array {path, name, current} where path is the template path, name is the template name and current is true if this is the current template, false otherwise.
multiarray_filter (   $field,
  $value,
  $array 
)

Filters a 2D array returning all the entries where $field is not equal to $value.

Returns
The filtered array.
multiarray_search (   $field,
  $value,
  $array,
  $default_value = false 
)

Search for the first item with value $value for field $field in a 2D array.

Returns
The sub-array or $default_value.
startswith (   $haystack,
  $needle 
)

Check that $haystack starts with $needle.