FfHelper
public class FfHelper
Method Summary | |
---|---|
string | arrayToString(array value) Returns the array as a comma separated list. |
array | array_combine(array keys, array values) Returns an array indexed by keys and containing values. |
string | escapeCommas(string value) A static function that replaces all commas with escaped commas "\,". |
string | escapeDoubleQuotes(string value) A static function that replaces all double quotes with escaped quotes '\"'. |
array | genArray(int start, int end, boolean pad) Returns an array of indices starting at start and ending at end. |
string | htmlify(string text, boolean convertNewLines) HTMLifys the text by converting all URLs and email addresses to hyperlinks. |
array | parseTabDeliminatedFile(mixed filename) Returns an array of arrays of data from the tab delimited file. |
void | pluralize(mixed word, mixed count) Returns the word as a pluralized word if count is greater than 1. |
string | Returns the footer (everything after and including the closing body tag) of a very basic W3C compliant web page. |
string | Returns the header (everything up to and including the body tag) of a very basic W3C compliant web page. |
void | scandir(mixed dir) Returns an array of files in the specified directory. |
array | stringToArray(string value) Converts a comma separated list to an array of strings |
void | stripos(mixed haystack, mixed needle) Returns the position of needle in haystack. |
the | toString(mixed value) Returns the value as a string. |
string | wordWrap(string str, int width, mixed br, boolean cut, string break) A static method that enhances PHP's wordwrap function by: 1 - Not considering HTML tags as characters 2 - Considering encoded UTF-8 characters, like "请" as a single character. |
public string arrayToString(array value)
Returns the array as a comma separated list. Note: all commas in the array element strings are escaped.
public array array_combine(array keys, array values)
Returns an array indexed by keys and containing values.
public string escapeCommas(string value)
A static function that replaces all commas with escaped commas "\,". This method is useful for escaping commas within a comma separated list.
public string escapeDoubleQuotes(string value)
A static function that replaces all double quotes with escaped quotes '\"'. This method is useful for escaping quotes within a string that will be passed to eval().
public array genArray(int start, int end, boolean pad)
Returns an array of indices starting at start and ending at end.
public string htmlify(string text, boolean convertNewLines)
HTMLifys the text by converting all URLs and email addresses to hyperlinks.
public array parseTabDeliminatedFile(mixed filename)
Returns an array of arrays of data from the tab delimited file.
public void pluralize(mixed word, mixed count)
Returns the word as a pluralized word if count is greater than 1. This method is good for descriptions that reference dynamic amounts where you don't wish to use "(s)". Note: this method doesn't work for any more complicated pluralization like adding "es".
public string printSimpleFfPageFooter()
Returns the footer (everything after and including the closing body tag) of a very basic W3C compliant web page.
public string printSimpleFfPageHeader()
Returns the header (everything up to and including the body tag) of a very basic W3C compliant web page.
public void scandir(mixed dir)
Returns an array of files in the specified directory.
public array stringToArray(string value)
Converts a comma separated list to an array of strings
public void stripos(mixed haystack, mixed needle)
Returns the position of needle in haystack.
public the toString(mixed value)
Returns the value as a string. If the value is a string already, the value is returned. Otherwise, the array of strings is converted into a comma separated list where the elements are NOT comma escaped.
public string wordWrap(string str, int width, mixed br, boolean cut, string break)
A static method that enhances PHP's wordwrap function by: 1 - Not considering HTML tags as characters 2 - Considering encoded UTF-8 characters, like "请" as a single character.
FfHelper contains common helper functions used by FORMfields.