| Next revision | Previous revision |
| scriptlog:lib:core:util [2026/09/26 09:09] – admin admin | scriptlog:lib:core:util [2026/09/26 09:34] (current) – admin admin |
|---|
| ======= Docblock Metadata ======= | ======= Docblock Metadata ======= |
| |
| ^ Tag ^ Value ^ | ^ Tag ^ Value ^ |
| | ''@author'' | Brandon Wamboldt <[email protected]> | | | ''@author'' | Brandon Wamboldt <[email protected]> | |
| |
| ======= Inheritance ======= | ======= Inheritance ======= |
| ======= Constants (18) ======= | ======= Constants (18) ======= |
| |
| ^ Visibility ^ Name ^ Value ^ Line ^ | ^ Visibility ^ Name ^ Value ^ Line ^ |
| | ''-'' | ''SECONDS_IN_A_MINUTE'' | ''60;'' | 29 | | | ''-'' | ''SECONDS_IN_A_MINUTE'' | ''60;'' | 29 | |
| | ''-'' | ''SECONDS_IN_A_HOUR'' | ''3600;'' | 37 | | | ''-'' | ''SECONDS_IN_A_HOUR'' | ''3600;'' | 37 | |
| | ''-'' | ''SECONDS_IN_AN_HOUR'' | ''3600;'' | 38 | | | ''-'' | ''SECONDS_IN_AN_HOUR'' | ''3600;'' | 38 | |
| | ''-'' | ''SECONDS_IN_A_DAY'' | ''86400;'' | 46 | | | ''-'' | ''SECONDS_IN_A_DAY'' | ''86400;'' | 46 | |
| | ''-'' | ''SECONDS_IN_A_WEEK'' | ''604800;'' | 54 | | | ''-'' | ''SECONDS_IN_A_WEEK'' | ''604800;'' | 54 | |
| | ''-'' | ''SECONDS_IN_A_MONTH'' | ''2_592_000;'' | 62 | | | ''-'' | ''SECONDS_IN_A_MONTH'' | ''2_592_000;'' | 62 | |
| | ''-'' | ''SECONDS_IN_A_YEAR'' | ''31_536_000;'' | 70 | | | ''-'' | ''SECONDS_IN_A_YEAR'' | ''31_536_000;'' | 70 | |
| | ''-'' | ''HTTP_URL_REPLACE'' | ''1;'' | 78 | | | ''-'' | ''HTTP_URL_REPLACE'' | ''1;'' | 78 | |
| | ''-'' | ''HTTP_URL_JOIN_PATH'' | ''2;'' | 79 | | | ''-'' | ''HTTP_URL_JOIN_PATH'' | ''2;'' | 79 | |
| | ''-'' | ''HTTP_URL_JOIN_QUERY'' | ''4;'' | 80 | | | ''-'' | ''HTTP_URL_JOIN_QUERY'' | ''4;'' | 80 | |
| | ''-'' | ''HTTP_URL_STRIP_USER'' | ''8;'' | 81 | | | ''-'' | ''HTTP_URL_STRIP_USER'' | ''8;'' | 81 | |
| | ''-'' | ''HTTP_URL_STRIP_PASS'' | ''16;'' | 82 | | | ''-'' | ''HTTP_URL_STRIP_PASS'' | ''16;'' | 82 | |
| | ''-'' | ''HTTP_URL_STRIP_AUTH'' | ''32;'' | 83 | | | ''-'' | ''HTTP_URL_STRIP_AUTH'' | ''32;'' | 83 | |
| | ''-'' | ''HTTP_URL_STRIP_PORT'' | ''64;'' | 84 | | | ''-'' | ''HTTP_URL_STRIP_PORT'' | ''64;'' | 84 | |
| | ''-'' | ''HTTP_URL_STRIP_PATH'' | ''128;'' | 85 | | | ''-'' | ''HTTP_URL_STRIP_PATH'' | ''128;'' | 85 | |
| | ''-'' | ''HTTP_URL_STRIP_QUERY'' | ''256;'' | 86 | | | ''-'' | ''HTTP_URL_STRIP_QUERY'' | ''256;'' | 86 | |
| | ''-'' | ''HTTP_URL_STRIP_FRAGMENT'' | ''512;'' | 87 | | | ''-'' | ''HTTP_URL_STRIP_FRAGMENT'' | ''512;'' | 87 | |
| | ''-'' | ''HTTP_URL_STRIP_ALL'' | ''1024;'' | 88 | | | ''-'' | ''HTTP_URL_STRIP_ALL'' | ''1024;'' | 88 | |
| |
| ======= Properties (8) ======= | ======= Properties (8) ======= |
| |
| ^ Visibility ^ Type ^ Name ^ Default ^ Line ^ | ^ Visibility ^ Type ^ Name ^ Default ^ Line ^ |
| | ''public static'' | ''static'' | ''$icon_collapse'' | '''iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAMAAADXT/YiAAAAGXRFWHRTb2…'' | 96 | | | ''public static'' | ''static'' | ''$icon_collapse'' | '''iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAMAAADXT/YiAAAAGXRFWHRTb2…'' | 96 | |
| | ''public static'' | ''static'' | ''$icon_expand'' | '''iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAMAAADXT/YiAAAAGXRFWHRTb2…'' | 104 | | | ''public static'' | ''static'' | ''$icon_expand'' | '''iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAMAAADXT/YiAAAAGXRFWHRTb2…'' | 104 | |
| | ''private static'' | ''static'' | ''$hasArray'' | ''false;'' | 106 | | | ''private static'' | ''static'' | ''$hasArray'' | ''false'' | 106 | |
| | ''public static'' | ''static'' | ''$maps'' | ''array( 'de' => array(/* German */ 'Ä' => 'Ae', 'Ö' => 'Oe',…'' | 116 | | | ''public static'' | ''static'' | ''$maps'' | ''array( 'de' => array(/* German */ 'Ä' => 'Ae', 'Ö' => 'Oe',…'' | 116 | |
| | ''private static'' | ''static'' | ''$map'' | ''array();'' | 223 | | | ''private static'' | ''static'' | ''$map'' | ''array()'' | 223 | |
| | ''private static'' | ''static'' | ''$chars'' | '''';'' | 230 | | | ''private static'' | ''static'' | ''$chars'' | '''''' | 230 | |
| | ''private static'' | ''static'' | ''$regex'' | '''';'' | 237 | | | ''private static'' | ''static'' | ''$regex'' | '''''' | 237 | |
| | ''private static'' | ''static'' | ''$language'' | '''';'' | 244 | | | ''private static'' | ''static'' | ''$language'' | '''''' | 244 | |
| |
| ======= Methods (70) ======= | ======= Methods (70) ======= |
| |
| ^ Visibility ^ Method ^ Summary ^ Line ^ | ^ Visibility ^ Method ^ Summary ^ Line ^ |
| | private static | ''initLanguageMap()'' | Initializes the character map. | 253 | | | private static | ''initLanguageMap()'' | Initializes the character map. | 253 | |
| | public static | ''array_get()'' | Access an array index, retrieving the value stored there if it | 294 | | | public static | ''array_get()'' | Access an array index, retrieving the value stored there if it | 294 | |
| | public static | ''var_dump()'' | Display a variable's contents using nice HTML formatting and will | 308 | | | public static | ''var_dump()'' | Display a variable's contents using nice HTML formatting and will | 308 | |
| | public static | ''var_dump_plain()'' | Display a variable's contents using nice HTML formatting (Without | 351 | | | public static | ''var_dump_plain()'' | Display a variable's contents using nice HTML formatting (Without | 351 | |
| | public static | ''slugify()'' | Converts any accent characters to their equivalent normal characters | 516 | | | public static | ''slugify()'' | Converts any accent characters to their equivalent normal characters | 516 | |
| | public static | ''seems_utf8()'' | Checks to see if a string is utf8 encoded. | 554 | | | public static | ''seems_utf8()'' | Checks to see if a string is utf8 encoded. | 554 | |
| | protected static | ''seemsUtf8Regex()'' | A non-Mbstring UTF-8 checker. | 573 | | | protected static | ''seemsUtf8Regex()'' | A non-Mbstring UTF-8 checker. | 573 | |
| | public static | ''size_format()'' | Nice formatting for computer sizes (Bytes). | 601 | | | public static | ''size_format()'' | Nice formatting for computer sizes (Bytes). | 601 | |
| | public static | ''maybe_serialize()'' | Serialize data, if needed. | 628 | | | public static | ''maybe_serialize()'' | Serialize data, if needed. | 628 | |
| | public static | ''maybe_unserialize()'' | Unserialize value only if it is serialized. | 643 | | | public static | ''maybe_unserialize()'' | Unserialize value only if it is serialized. | 643 | |
| | public static | ''is_serialized()'' | Check value to find if it was serialized. | 695 | | | public static | ''is_serialized()'' | Check value to find if it was serialized. | 695 | |
| | public static | ''fix_broken_serialization()'' | Unserializes partially-corrupted arrays that occur sometimes. Addresses | 735 | | | public static | ''fix_broken_serialization()'' | Unserializes partially-corrupted arrays that occur sometimes. Addresses | 735 | |
| | public static | ''is_https()'' | Checks to see if the page is being server over SSL or not | 750 | | | public static | ''is_https()'' | Checks to see if the page is being server over SSL or not | 750 | |
| | public static | ''add_query_arg()'' | Add or remove query arguments to the URL. | 763 | | | public static | ''add_query_arg()'' | Add or remove query arguments to the URL. | 763 | |
| | public static | ''remove_query_arg()'' | Removes an item or list from the query string. | 831 | | | public static | ''remove_query_arg()'' | Removes an item or list from the query string. | 831 | |
| | public static | ''http_build_url()'' | Build a URL. | 858 | | | public static | ''http_build_url()'' | Build a URL. | 858 | |
| | public static | ''str_to_bool()'' | Converts many english words that equate to true or false to boolean. | 983 | | | public static | ''str_to_bool()'' | Converts many english words that equate to true or false to boolean. | 983 | |
| | public static | ''starts_with()'' | Check if a string starts with the given string. | 1004 | | | public static | ''starts_with()'' | Check if a string starts with the given string. | 1004 | |
| | public static | ''ends_with()'' | Check if a string ends with the given string. | 1016 | | | public static | ''ends_with()'' | Check if a string ends with the given string. | 1016 | |
| | public static | ''str_contains()'' | Check if a string contains another string. | 1028 | | | public static | ''str_contains()'' | Check if a string contains another string. | 1028 | |
| | public static | ''str_icontains()'' | Check if a string contains another string. This version is case | 1041 | | | public static | ''str_icontains()'' | Check if a string contains another string. This version is case | 1041 | |
| | public static | ''get_file_ext()'' | Return the file extension of the given filename. | 1052 | | | public static | ''get_file_ext()'' | Return the file extension of the given filename. | 1052 | |
| | public static | ''rmdir()'' | Removes a directory (and its contents) recursively. | 1067 | | | public static | ''rmdir()'' | Removes a directory (and its contents) recursively. | 1067 | |
| | public static | ''htmlentities()'' | Convert entities, while preserving already-encoded entities. | 1117 | | | public static | ''htmlentities()'' | Convert entities, while preserving already-encoded entities. | 1117 | |
| | public static | ''htmlspecialchars()'' | Convert >, <, ', " and & to html entities, but preserves entities that | 1142 | | | public static | ''htmlspecialchars()'' | Convert >, <, ', " and & to html entities, but preserves entities that | 1142 | |
| | public static | ''downcode()'' | Transliterates characters to their ASCII equivalents. | 1172 | | | public static | ''downcode()'' | Transliterates characters to their ASCII equivalents. | 1172 | |
| | public static | ''remove_accents()'' | Converts all accent characters to ASCII characters. | 1212 | | | public static | ''remove_accents()'' | Converts all accent characters to ASCII characters. | 1212 | |
| | public static | ''strip_space()'' | Strip all witespaces from the given string. | 1227 | | | public static | ''strip_space()'' | Strip all witespaces from the given string. | 1227 | |
| | public static | ''sanitize_string()'' | Sanitize a string by performing the following operation : | 1242 | | | public static | ''sanitize_string()'' | Sanitize a string by performing the following operation : | 1242 | |
| | public static | ''zero_pad()'' | Pads a given string with zeroes on the left. | 1259 | | | public static | ''zero_pad()'' | Pads a given string with zeroes on the left. | 1259 | |
| | public static | ''human_time_diff()'' | Converts a unix timestamp to a relative time string, such as "3 days ago" | 1273 | | | public static | ''human_time_diff()'' | Converts a unix timestamp to a relative time string, such as "3 days ago" | 1273 | |
| | public static | ''number_to_word()'' | Converts a number into the text equivalent. For example, 456 becomes four | 1330 | | | public static | ''number_to_word()'' | Converts a number into the text equivalent. For example, 456 becomes four | 1330 | |
| | protected static | ''numberToWordConvertGroup()'' | (undocumented) | 1386 | | | protected static | ''numberToWordConvertGroup()'' | (undocumented) | 1386 | |
| | protected static | ''numberToWordThreeDigits()'' | (undocumented) | 1418 | | | protected static | ''numberToWordThreeDigits()'' | (undocumented) | 1418 | |
| | protected static | ''numberToWordTwoDigits()'' | (undocumented) | 1442 | | | protected static | ''numberToWordTwoDigits()'' | (undocumented) | 1442 | |
| | protected static | ''numberToWordConvertDigit()'' | string | 1515 | | | protected static | ''numberToWordConvertDigit()'' | string | 1515 | |
| | public static | ''utf8_headers()'' | Transmit UTF-8 content headers if the headers haven't already been sent. | 1549 | | | public static | ''utf8_headers()'' | Transmit UTF-8 content headers if the headers haven't already been sent. | 1549 | |
| | public static | ''force_download()'' | Transmit headers that force a browser to display the download file | 1574 | | | public static | ''force_download()'' | Transmit headers that force a browser to display the download file | 1574 | |
| | public static | ''nocache_headers()'' | Sets the headers to prevent caching for the different browsers. | 1621 | | | public static | ''nocache_headers()'' | Sets the headers to prevent caching for the different browsers. | 1621 | |
| | public static | ''random_string()'' | Generates a string of random characters. | 1659 | | | public static | ''random_string()'' | Generates a string of random characters. | 1659 | |
| | public static | ''secure_random_string()'' | Generate secure random string of given length | 1721 | | | public static | ''secure_random_string()'' | Generate secure random string of given length | 1721 | |
| | public static | ''match_string()'' | Check if a given string matches a given pattern. | 1747 | | | public static | ''match_string()'' | Check if a given string matches a given pattern. | 1747 | |
| | public static | ''validate_email()'' | Validate an email address. | 1771 | | | public static | ''validate_email()'' | Validate an email address. | 1771 | |
| | public static | ''get_gravatar()'' | Return the URL to a user's gravatar. | 1783 | | | public static | ''get_gravatar()'' | Return the URL to a user's gravatar. | 1783 | |
| | public static | ''linkify()'' | Turns all of the links in a string into HTML links. | 1804 | | | public static | ''linkify()'' | Turns all of the links in a string into HTML links. | 1804 | |
| | protected static | ''linkifyRegex()'' | Callback for the preg_replace in the linkify() method. | 1831 | | | protected static | ''linkifyRegex()'' | Callback for the preg_replace in the linkify() method. | 1831 | |
| | protected static | ''linkifyCallback()'' | Callback for the preg_replace in the linkify() method. | 1887 | | | protected static | ''linkifyCallback()'' | Callback for the preg_replace in the linkify() method. | 1887 | |
| | public static | ''get_current_url()'' | Return the current URL. | 1901 | | | public static | ''get_current_url()'' | Return the current URL. | 1901 | |
| | public static | ''get_client_ip()'' | Returns the IP address of the client. | 1964 | | | public static | ''get_client_ip()'' | Returns the IP address of the client. | 1964 | |
| | public static | ''safe_truncate()'' | Truncate a string to a specified length without cutting a word off. | 1990 | | | public static | ''safe_truncate()'' | Truncate a string to a specified length without cutting a word off. | 1990 | |
| | public static | ''limit_characters()'' | Truncate the string to given length of charactes. | 2015 | | | public static | ''limit_characters()'' | Truncate the string to given length of charactes. | 2015 | |
| | public static | ''limit_words()'' | Truncate the string to given length of words. | 2032 | | | public static | ''limit_words()'' | Truncate the string to given length of words. | 2032 | |
| | public static | ''ordinal()'' | Returns the ordinal version of a number (appends th, st, nd, rd). | 2049 | | | public static | ''ordinal()'' | Returns the ordinal version of a number (appends th, st, nd, rd). | 2049 | |
| | public static | ''full_permissions()'' | Returns the file permissions as a nice string, like -rw-r--r-- or false | 2067 | | | public static | ''full_permissions()'' | Returns the file permissions as a nice string, like -rw-r--r-- or false | 2067 | |
| | public static | ''array_first()'' | Returns the first element in an array. | 2132 | | | public static | ''array_first()'' | Returns the first element in an array. | 2132 | |
| | public static | ''array_last()'' | Returns the last element in an array. | 2143 | | | public static | ''array_last()'' | Returns the last element in an array. | 2143 | |
| | public static | ''array_first_key()'' | Returns the first key in an array. | 2154 | | | public static | ''array_first_key()'' | Returns the first key in an array. | 2154 | |
| | public static | ''array_last_key()'' | Returns the last key in an array. | 2167 | | | public static | ''array_last_key()'' | Returns the last key in an array. | 2167 | |
| | public static | ''array_flatten()'' | Flatten a multi-dimensional array into a one dimensional array. | 2185 | | | public static | ''array_flatten()'' | Flatten a multi-dimensional array into a one dimensional array. | 2185 | |
| | public static | ''array_pluck()'' | Accepts an array, and returns an array of values from that array as | 2214 | | | public static | ''array_pluck()'' | Accepts an array, and returns an array of values from that array as | 2214 | |
| | public static | ''array_search_deep()'' | Searches for a given value in an array of arrays, objects and scalar | 2256 | | | public static | ''array_search_deep()'' | Searches for a given value in an array of arrays, objects and scalar | 2256 | |
| | public static | ''array_map_deep()'' | Returns an array containing all the elements of arr1 after applying | 2304 | | | public static | ''array_map_deep()'' | Returns an array containing all the elements of arr1 after applying | 2304 | |
| | public static | ''array_clean()'' | (undocumented) | 2318 | | | public static | ''array_clean()'' | (undocumented) | 2318 | |
| | protected static | ''mbInternalEncoding()'' | Wrapper to prevent errors if the user doesn't have the mbstring | 2330 | | | protected static | ''mbInternalEncoding()'' | Wrapper to prevent errors if the user doesn't have the mbstring | 2330 | |
| | public static | ''set_writable()'' | Set the writable bit on a file to the minimum value that allows the user | 2349 | | | public static | ''set_writable()'' | Set the writable bit on a file to the minimum value that allows the user | 2349 | |
| | public static | ''set_readable()'' | Set the readable bit on a file to the minimum value that allows the user | 2401 | | | public static | ''set_readable()'' | Set the readable bit on a file to the minimum value that allows the user | 2401 | |
| | public static | ''set_executable()'' | Set the executable bit on a file to the minimum value that allows the | 2453 | | | public static | ''set_executable()'' | Set the executable bit on a file to the minimum value that allows the | 2453 | |
| | public static | ''directory_size()'' | Returns size of a given directory in bytes. | 2503 | | | public static | ''directory_size()'' | Returns size of a given directory in bytes. | 2503 | |
| | public static | ''get_user_directory()'' | Returns a home directory of current user. | 2519 | | | public static | ''get_user_directory()'' | Returns a home directory of current user. | 2519 | |
| | public static | ''directory_contents()'' | Returns all paths inside a directory. | 2534 | | | public static | ''directory_contents()'' | Returns all paths inside a directory. | 2534 | |
| |
| |
| Part of the URLify.php Project <https://github.com/jbroadway/urlify/> | Part of the URLify.php Project <https://github.com/jbroadway/urlify/> |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$language'' | ''(untyped)'' | '''''' | //none// | | | ''$language'' | ''(untyped)'' | '''''' | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| raising a warning. | raising a warning. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$var (by reference)'' | ''(untyped)'' | //required// | Array value to access | | | ''$var (by reference)'' | ''(untyped)'' | //required// | Array value to access | |
| | ''$default'' | ''(untyped)'' | ''null'' | Default value to return if the key is not present in the array | | | ''$default'' | ''(untyped)'' | ''null'' | Default value to return if the key is not present in the array | |
| |
| **Returns:** ''(none declared)'' — mixed | **Returns:** ''(none declared)'' — mixed |
| properly display the value of booleans as true or false | properly display the value of booleans as true or false |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$var'' | ''(untyped)'' | //required// | The variable to dump | | | ''$var'' | ''(untyped)'' | //required// | The variable to dump | |
| | ''$return'' | ''(untyped)'' | ''false'' | //none// | | | ''$return'' | ''(untyped)'' | ''false'' | //none// | |
| | ''$expandLevel'' | ''(untyped)'' | ''1'' | //none// | | | ''$expandLevel'' | ''(untyped)'' | ''1'' | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| as well. | as well. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$var'' | ''(untyped)'' | //required// | The variable to dump | | | ''$var'' | ''(untyped)'' | //required// | The variable to dump | |
| | ''$expLevel'' | ''(untyped)'' | //required// | //none// | | | ''$expLevel'' | ''(untyped)'' | //required// | //none// | |
| | ''$depth'' | ''(untyped)'' | ''0'' | //none// | | | ''$depth'' | ''(untyped)'' | ''0'' | //none// | |
| | ''$done'' | ''(untyped)'' | ''array()'' | //none// | | | ''$done'' | ''(untyped)'' | ''array()'' | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| classes or IDs. | classes or IDs. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$string'' | ''(untyped)'' | //required// | A string to convert to a slug | | | ''$string'' | ''(untyped)'' | //required// | A string to convert to a slug | |
| | ''$separator'' | ''(untyped)'' | '''-''' | The string to separate words with | | | ''$separator'' | ''(untyped)'' | '''-''' | The string to separate words with | |
| | ''$css_mode'' | ''(untyped)'' | ''false'' | Whether or not to generate strings safe for CSS classes/IDs (Default to false) | | | ''$css_mode'' | ''(untyped)'' | ''false'' | Whether or not to generate strings safe for CSS classes/IDs (Default to false) | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Written by Tony Ferrara <http://blog.ircmaxwell.com> | Written by Tony Ferrara <http://blog.ircmaxwell.com> |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$string'' | ''(untyped)'' | //required// | The string to be checked | | | ''$string'' | ''(untyped)'' | //required// | The string to be checked | |
| |
| **Returns:** ''(none declared)'' — boolean | **Returns:** ''(none declared)'' — boolean |
| A non-Mbstring UTF-8 checker. | A non-Mbstring UTF-8 checker. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$string'' | ''(untyped)'' | //required// | //none// | | | ''$string'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — bool | **Returns:** ''(none declared)'' — bool |
| Nice formatting for computer sizes (Bytes). | Nice formatting for computer sizes (Bytes). |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$bytes'' | ''(untyped)'' | //required// | The number in bytes to format | | | ''$bytes'' | ''(untyped)'' | //required// | The number in bytes to format | |
| | ''$decimals'' | ''(untyped)'' | ''0'' | The number of decimal points to include | | | ''$decimals'' | ''(untyped)'' | ''0'' | The number of decimal points to include | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Serialize data, if needed. | Serialize data, if needed. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$data'' | ''(untyped)'' | //required// | Data that might need to be serialized | | | ''$data'' | ''(untyped)'' | //required// | Data that might need to be serialized | |
| |
| **Returns:** ''(none declared)'' — mixed | **Returns:** ''(none declared)'' — mixed |
| Unserialize value only if it is serialized. | Unserialize value only if it is serialized. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$data'' | ''(untyped)'' | //required// | A variable that may or may not be serialized | | | ''$data'' | ''(untyped)'' | //required// | A variable that may or may not be serialized | |
| |
| **Returns:** ''(none declared)'' — mixed | **Returns:** ''(none declared)'' — mixed |
| Serialized data is always a string. | Serialized data is always a string. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$data'' | ''(untyped)'' | //required// | Value to check to see if was serialized | | | ''$data'' | ''(untyped)'' | //required// | Value to check to see if was serialized | |
| |
| **Returns:** ''(none declared)'' — boolean | **Returns:** ''(none declared)'' — boolean |
| Contributed by Theodore R. Smith of PHP Experts, Inc. <http://www.phpexperts.pro/> | Contributed by Theodore R. Smith of PHP Experts, Inc. <http://www.phpexperts.pro/> |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$brokenSerializedData'' | ''(untyped)'' | //required// | //none// | | | ''$brokenSerializedData'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Add or remove query arguments to the URL. | Add or remove query arguments to the URL. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$newKey'' | ''(untyped)'' | //required// | Either newkey or an associative array | | | ''$newKey'' | ''(untyped)'' | //required// | Either newkey or an associative array | |
| | ''$newValue'' | ''(untyped)'' | ''null'' | Either newvalue or oldquery or uri | | | ''$newValue'' | ''(untyped)'' | ''null'' | Either newvalue or oldquery or uri | |
| | ''$uri'' | ''(untyped)'' | ''null'' | URI or URL to append the queru/queries to. | | | ''$uri'' | ''(untyped)'' | ''null'' | URI or URL to append the queru/queries to. | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Removes an item or list from the query string. | Removes an item or list from the query string. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$keys'' | ''(untyped)'' | //required// | Query key or keys to remove. | | | ''$keys'' | ''(untyped)'' | //required// | Query key or keys to remove. | |
| | ''$uri'' | ''(untyped)'' | ''null'' | When false uses the $_SERVER value | | | ''$uri'' | ''(untyped)'' | ''null'' | When false uses the $_SERVER value | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| the flags argument. | the flags argument. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$url'' | ''(untyped)'' | //required// | (part(s) of) an URL in form of a string or associative array like parse_url() returns | | | ''$url'' | ''(untyped)'' | //required// | (part(s) of) an URL in form of a string or associative array like parse_url() returns | |
| | ''$parts'' | ''(untyped)'' | ''array()'' | same as the first argument | | | ''$parts'' | ''(untyped)'' | ''array()'' | same as the first argument | |
| | ''$flags'' | ''(untyped)'' | ''self::HTTP_URL_REPLACE'' | a bitmask of binary or'ed HTTP_URL constants; HTTP_URL_REPLACE is the default | | | ''$flags'' | ''(untyped)'' | ''self::HTTP_URL_REPLACE'' | a bitmask of binary or'ed HTTP_URL constants; HTTP_URL_REPLACE is the default | |
| | ''$new_url (by reference)'' | ''(untyped)'' | ''array()'' | if set, it will be filled with the parts of the composed url like parse_url() would return | | | ''$new_url (by reference)'' | ''(untyped)'' | ''array()'' | if set, it will be filled with the parts of the composed url like parse_url() would return | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Supports 'y', 'n', 'yes', 'no' and a few other variations. | Supports 'y', 'n', 'yes', 'no' and a few other variations. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$string'' | ''(untyped)'' | //required// | The string to convert to boolean | | | ''$string'' | ''(untyped)'' | //required// | The string to convert to boolean | |
| | ''$default'' | ''(untyped)'' | ''false'' | The value to return if we can't match any yes/no words | | | ''$default'' | ''(untyped)'' | ''false'' | The value to return if we can't match any yes/no words | |
| |
| **Returns:** ''(none declared)'' — boolean | **Returns:** ''(none declared)'' — boolean |
| Check if a string starts with the given string. | Check if a string starts with the given string. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$string'' | ''(untyped)'' | //required// | //none// | | | ''$string'' | ''(untyped)'' | //required// | //none// | |
| | ''$starts_with'' | ''(untyped)'' | //required// | //none// | | | ''$starts_with'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — boolean | **Returns:** ''(none declared)'' — boolean |
| Check if a string ends with the given string. | Check if a string ends with the given string. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$string'' | ''(untyped)'' | //required// | //none// | | | ''$string'' | ''(untyped)'' | //required// | //none// | |
| | ''$ends_with'' | ''(untyped)'' | //required// | //none// | | | ''$ends_with'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — boolean | **Returns:** ''(none declared)'' — boolean |
| Check if a string contains another string. | Check if a string contains another string. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$haystack'' | ''(untyped)'' | //required// | //none// | | | ''$haystack'' | ''(untyped)'' | //required// | //none// | |
| | ''$needle'' | ''(untyped)'' | //required// | //none// | | | ''$needle'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — boolean | **Returns:** ''(none declared)'' — boolean |
| insensitive. | insensitive. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$haystack'' | ''(untyped)'' | //required// | //none// | | | ''$haystack'' | ''(untyped)'' | //required// | //none// | |
| | ''$needle'' | ''(untyped)'' | //required// | //none// | | | ''$needle'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — boolean | **Returns:** ''(none declared)'' — boolean |
| Return the file extension of the given filename. | Return the file extension of the given filename. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$filename'' | ''(untyped)'' | //required// | //none// | | | ''$filename'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Contributed by Askar (ARACOOL) <https://github.com/ARACOOOL> | Contributed by Askar (ARACOOL) <https://github.com/ARACOOOL> |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$dir'' | ''(untyped)'' | //required// | The directory to be deleted recursively | | | ''$dir'' | ''(untyped)'' | //required// | The directory to be deleted recursively | |
| | ''$traverseSymlinks'' | ''(untyped)'' | ''false'' | Delete contents of symlinks recursively | | | ''$traverseSymlinks'' | ''(untyped)'' | ''false'' | Delete contents of symlinks recursively | |
| |
| **Returns:** ''(none declared)'' — bool | **Returns:** ''(none declared)'' — bool |
| Convert entities, while preserving already-encoded entities. | Convert entities, while preserving already-encoded entities. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$string'' | ''(untyped)'' | //required// | The text to be converted | | | ''$string'' | ''(untyped)'' | //required// | The text to be converted | |
| | ''$preserve_encoded_entities'' | ''(untyped)'' | ''false'' | //none// | | | ''$preserve_encoded_entities'' | ''(untyped)'' | ''false'' | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| are already encoded. | are already encoded. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$string'' | ''(untyped)'' | //required// | The text to be converted | | | ''$string'' | ''(untyped)'' | //required// | The text to be converted | |
| | ''$preserve_encoded_entities'' | ''(untyped)'' | ''false'' | //none// | | | ''$preserve_encoded_entities'' | ''(untyped)'' | ''false'' | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Part of the URLify.php Project <https://github.com/jbroadway/urlify/> | Part of the URLify.php Project <https://github.com/jbroadway/urlify/> |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$text'' | ''(untyped)'' | //required// | Text that might have not-ASCII characters | | | ''$text'' | ''(untyped)'' | //required// | Text that might have not-ASCII characters | |
| | ''$language'' | ''(untyped)'' | '''''' | Specifies a priority for a specific language. | | | ''$language'' | ''(untyped)'' | '''''' | Specifies a priority for a specific language. | |
| |
| **Returns:** ''(none declared)'' — string Filtered string with replaced "nice" characters | **Returns:** ''(none declared)'' — string Filtered string with replaced "nice" characters |
| returned. | returned. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$string'' | ''(untyped)'' | //required// | Text that might have accent characters | | | ''$string'' | ''(untyped)'' | //required// | Text that might have accent characters | |
| | ''$language'' | ''(untyped)'' | '''''' | Specifies a priority for a specific language. | | | ''$language'' | ''(untyped)'' | '''''' | Specifies a priority for a specific language. | |
| |
| **Returns:** ''(none declared)'' — string Filtered string with replaced "nice" characters | **Returns:** ''(none declared)'' — string Filtered string with replaced "nice" characters |
| Strip all witespaces from the given string. | Strip all witespaces from the given string. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$string'' | ''(untyped)'' | //required// | The string to strip | | | ''$string'' | ''(untyped)'' | //required// | The string to strip | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| \- Strip whitespaces | \- Strip whitespaces |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$string'' | ''(untyped)'' | //required// | the string to sanitize | | | ''$string'' | ''(untyped)'' | //required// | the string to sanitize | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Pads a given string with zeroes on the left. | Pads a given string with zeroes on the left. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$number'' | ''(untyped)'' | //required// | The number to pad | | | ''$number'' | ''(untyped)'' | //required// | The number to pad | |
| | ''$length'' | ''(untyped)'' | //required// | The total length of the desired string | | | ''$length'' | ''(untyped)'' | //required// | The total length of the desired string | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| or "2 weeks ago". | or "2 weeks ago". |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$from'' | ''(untyped)'' | //required// | The date to use as a starting point | | | ''$from'' | ''(untyped)'' | //required// | The date to use as a starting point | |
| | ''$to'' | ''(untyped)'' | '''''' | The date to compare to, defaults to now | | | ''$to'' | ''(untyped)'' | '''''' | The date to compare to, defaults to now | |
| | ''$as_text'' | ''(untyped)'' | ''false'' | //none// | | | ''$as_text'' | ''(untyped)'' | ''false'' | //none// | |
| | ''$suffix'' | ''(untyped)'' | ''' ago''' | The string to add to the end, defaults to " ago" | | | ''$suffix'' | ''(untyped)'' | ''' ago''' | The string to add to the end, defaults to " ago" | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Part of the IntToWords Project. | Part of the IntToWords Project. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$number'' | ''(untyped)'' | //required// | The number to convert into text | | | ''$number'' | ''(untyped)'' | //required// | The number to convert into text | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| //lines 1386–1416 (31)// | //lines 1386–1416 (31)// |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$index'' | ''(untyped)'' | //required// | //none// | | | ''$index'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| //lines 1418–1440 (23)// | //lines 1418–1440 (23)// |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$digit1'' | ''(untyped)'' | //required// | //none// | | | ''$digit1'' | ''(untyped)'' | //required// | //none// | |
| | ''$digit2'' | ''(untyped)'' | //required// | //none// | | | ''$digit2'' | ''(untyped)'' | //required// | //none// | |
| | ''$digit3'' | ''(untyped)'' | //required// | //none// | | | ''$digit3'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| //lines 1442–1508 (67)// | //lines 1442–1508 (67)// |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$digit1'' | ''(untyped)'' | //required// | //none// | | | ''$digit1'' | ''(untyped)'' | //required// | //none// | |
| | ''$digit2'' | ''(untyped)'' | //required// | //none// | | | ''$digit2'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| //lines 1515–1541 (27)// | //lines 1515–1541 (27)// |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$digit'' | ''(untyped)'' | //required// | //none// | | | ''$digit'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Transmit UTF-8 content headers if the headers haven't already been sent. | Transmit UTF-8 content headers if the headers haven't already been sent. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$content_type'' | ''(untyped)'' | '''text/html''' | The content type to send out | | | ''$content_type'' | ''(untyped)'' | '''text/html''' | The content type to send out | |
| |
| **Returns:** ''(none declared)'' — boolean | **Returns:** ''(none declared)'' — boolean |
| already been sent. | already been sent. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$filename'' | ''(untyped)'' | //required// | The name of the filename to display to browsers | | | ''$filename'' | ''(untyped)'' | //required// | The name of the filename to display to browsers | |
| | ''$content'' | ''(untyped)'' | ''false'' | The content to output for the download. If you don't specify this, just the headers will be sent | | | ''$content'' | ''(untyped)'' | ''false'' | The content to output for the download. If you don't specify this, just the headers will be sent | |
| |
| **Returns:** ''(none declared)'' — boolean | **Returns:** ''(none declared)'' — boolean |
| Generates a string of random characters. | Generates a string of random characters. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$length'' | ''(untyped)'' | ''16'' | The length of the string to generate | | | ''$length'' | ''(untyped)'' | ''16'' | The length of the string to generate | |
| | ''$human_friendly'' | ''(untyped)'' | ''true'' | Whether or not to make the string human friendly by removing characters that can be confused with other characters ( O and 0, l and 1, etc) | | | ''$human_friendly'' | ''(untyped)'' | ''true'' | Whether or not to make the string human friendly by removing characters that can be confused with other characters ( O and 0, l and 1, etc) | |
| | ''$include_symbols'' | ''(untyped)'' | ''false'' | Whether or not to include symbols in the string. Can not be enabled if $human_friendly is true | | | ''$include_symbols'' | ''(untyped)'' | ''false'' | Whether or not to include symbols in the string. Can not be enabled if $human_friendly is true | |
| | ''$no_duplicate_chars'' | ''(untyped)'' | ''false'' | Whether or not to only use characters once in the string. | | | ''$no_duplicate_chars'' | ''(untyped)'' | ''false'' | Whether or not to only use characters once in the string. | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Part of the Laravel Project <https://github.com/laravel/laravel> | Part of the Laravel Project <https://github.com/laravel/laravel> |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$length'' | ''(untyped)'' | ''16'' | length of string | | | ''$length'' | ''(untyped)'' | ''16'' | length of string | |
| |
| **Returns:** ''(none declared)'' — bool | **Returns:** ''(none declared)'' — bool |
| Contributed by Abhimanyu Sharma <https://github.com/abhimanyusharma003> | Contributed by Abhimanyu Sharma <https://github.com/abhimanyusharma003> |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$pattern'' | ''(untyped)'' | //required// | Parttern of string exptected | | | ''$pattern'' | ''(untyped)'' | //required// | Parttern of string exptected | |
| | ''$string'' | ''(untyped)'' | //required// | String that need to be matched | | | ''$string'' | ''(untyped)'' | //required// | String that need to be matched | |
| | ''$caseSensitive'' | ''(untyped)'' | ''true'' | //none// | | | ''$caseSensitive'' | ''(untyped)'' | ''true'' | //none// | |
| |
| **Returns:** ''(none declared)'' — bool | **Returns:** ''(none declared)'' — bool |
| Validate an email address. | Validate an email address. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$possible_email'' | ''(untyped)'' | //required// | An email address to validate | | | ''$possible_email'' | ''(untyped)'' | //required// | An email address to validate | |
| |
| **Returns:** ''(none declared)'' — bool | **Returns:** ''(none declared)'' — bool |
| Return the URL to a user's gravatar. | Return the URL to a user's gravatar. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$email'' | ''(untyped)'' | //required// | The email of the user | | | ''$email'' | ''(untyped)'' | //required// | The email of the user | |
| | ''$size'' | ''(untyped)'' | ''32'' | The size of the gravatar | | | ''$size'' | ''(untyped)'' | ''32'' | The size of the gravatar | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Part of the LinkifyURL Project <https://github.com/jmrware/LinkifyURL> | Part of the LinkifyURL Project <https://github.com/jmrware/LinkifyURL> |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$text'' | ''(untyped)'' | //required// | The string to parse | | | ''$text'' | ''(untyped)'' | //required// | The string to parse | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Part of the LinkifyURL Project <https://github.com/jmrware/LinkifyURL> | Part of the LinkifyURL Project <https://github.com/jmrware/LinkifyURL> |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$text'' | ''(untyped)'' | //required// | //none// | | | ''$text'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Part of the LinkifyURL Project <https://github.com/jmrware/LinkifyURL> | Part of the LinkifyURL Project <https://github.com/jmrware/LinkifyURL> |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$matches'' | ''(untyped)'' | //required// | Matches from the preg_ function | | | ''$matches'' | ''(untyped)'' | //required// | Matches from the preg_ function | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Returns the IP address of the client. | Returns the IP address of the client. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$trust_proxy_headers'' | ''(untyped)'' | ''false'' | Whether or not to trust the proxy headers HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR. ONLY use if your server is behind a proxy that sets these values | | | ''$trust_proxy_headers'' | ''(untyped)'' | ''false'' | Whether or not to trust the proxy headers HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR. ONLY use if your server is behind a proxy that sets these values | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Truncate a string to a specified length without cutting a word off. | Truncate a string to a specified length without cutting a word off. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$string'' | ''(untyped)'' | //required// | The string to truncate | | | ''$string'' | ''(untyped)'' | //required// | The string to truncate | |
| | ''$length'' | ''(untyped)'' | //required// | The length to truncate the string to | | | ''$length'' | ''(untyped)'' | //required// | The length to truncate the string to | |
| | ''$append'' | ''(untyped)'' | '''...''' | Text to append to the string IF it gets truncated, defaults to '...' | | | ''$append'' | ''(untyped)'' | '''...''' | Text to append to the string IF it gets truncated, defaults to '...' | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Truncate the string to given length of charactes. | Truncate the string to given length of charactes. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$string'' | ''(untyped)'' | //required// | //none// | | | ''$string'' | ''(untyped)'' | //required// | //none// | |
| | ''$limit'' | ''(untyped)'' | ''100'' | //none// | | | ''$limit'' | ''(untyped)'' | ''100'' | //none// | |
| | ''$append'' | ''(untyped)'' | '''...''' | //none// | | | ''$append'' | ''(untyped)'' | '''...''' | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Truncate the string to given length of words. | Truncate the string to given length of words. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$string'' | ''(untyped)'' | //required// | //none// | | | ''$string'' | ''(untyped)'' | //required// | //none// | |
| | ''$limit'' | ''(untyped)'' | ''100'' | //none// | | | ''$limit'' | ''(untyped)'' | ''100'' | //none// | |
| | ''$append'' | ''(untyped)'' | '''...''' | //none// | | | ''$append'' | ''(untyped)'' | '''...''' | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Returns the ordinal version of a number (appends th, st, nd, rd). | Returns the ordinal version of a number (appends th, st, nd, rd). |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$number'' | ''(untyped)'' | //required// | The number to append an ordinal suffix to | | | ''$number'' | ''(untyped)'' | //required// | The number to append an ordinal suffix to | |
| | ''$locale'' | ''(untyped)'' | //required// | //none// | | | ''$locale'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| if the file is not found. | if the file is not found. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$file'' | ''(untyped)'' | //required// | The name of the file to get permissions form | | | ''$file'' | ''(untyped)'' | //required// | The name of the file to get permissions form | |
| | ''$perms'' | ''(untyped)'' | ''null'' | Numerical value of permissions to display as text. | | | ''$perms'' | ''(untyped)'' | ''null'' | Numerical value of permissions to display as text. | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Returns the first element in an array. | Returns the first element in an array. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$array'' | ''array'' | //required// | //none// | | | ''$array'' | ''array'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — mixed | **Returns:** ''(none declared)'' — mixed |
| Returns the last element in an array. | Returns the last element in an array. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$array'' | ''array'' | //required// | //none// | | | ''$array'' | ''array'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — mixed | **Returns:** ''(none declared)'' — mixed |
| Returns the first key in an array. | Returns the first key in an array. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$array'' | ''array'' | //required// | //none// | | | ''$array'' | ''array'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — int|string | **Returns:** ''(none declared)'' — int|string |
| Returns the last key in an array. | Returns the last key in an array. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$array'' | ''array'' | //required// | //none// | | | ''$array'' | ''array'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — int|string | **Returns:** ''(none declared)'' — int|string |
| Contributed by Theodore R. Smith of PHP Experts, Inc. <http://www.phpexperts.pro/> | Contributed by Theodore R. Smith of PHP Experts, Inc. <http://www.phpexperts.pro/> |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$array'' | ''array'' | //required// | The array to flatten | | | ''$array'' | ''array'' | //required// | The array to flatten | |
| | ''$preserve_keys'' | ''(untyped)'' | ''true'' | Whether or not to preserve array keys. Keys from deeply nested arrays will overwrite keys from shallowy nested arrays | | | ''$preserve_keys'' | ''(untyped)'' | ''true'' | Whether or not to preserve array keys. Keys from deeply nested arrays will overwrite keys from shallowy nested arrays | |
| |
| **Returns:** ''(none declared)'' — array | **Returns:** ''(none declared)'' — array |
| return an array of values from $array[]->name. | return an array of values from $array[]->name. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$array'' | ''array'' | //required// | An array | | | ''$array'' | ''array'' | //required// | An array | |
| | ''$field'' | ''(untyped)'' | //required// | The field to get values from | | | ''$field'' | ''(untyped)'' | //required// | The field to get values from | |
| | ''$preserve_keys'' | ''(untyped)'' | ''true'' | Whether or not to preserve the array keys | | | ''$preserve_keys'' | ''(untyped)'' | ''true'' | Whether or not to preserve the array keys | |
| | ''$remove_nomatches'' | ''(untyped)'' | ''true'' | If the field doesn't appear to be set, remove it from the array | | | ''$remove_nomatches'' | ''(untyped)'' | ''true'' | If the field doesn't appear to be set, remove it from the array | |
| |
| **Returns:** ''(none declared)'' — array | **Returns:** ''(none declared)'' — array |
| objects to search in. | objects to search in. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$array'' | ''array'' | //required// | The array to search | | | ''$array'' | ''array'' | //required// | The array to search | |
| | ''$search'' | ''(untyped)'' | //required// | The value to search for | | | ''$search'' | ''(untyped)'' | //required// | The value to search for | |
| | ''$field'' | ''(untyped)'' | ''false'' | The field to search in, if not specified all fields will be searched | | | ''$field'' | ''(untyped)'' | ''false'' | The field to search in, if not specified all fields will be searched | |
| |
| **Returns:** ''(none declared)'' — boolean|scalar False on failure or the array key on success | **Returns:** ''(none declared)'' — boolean|scalar False on failure or the array key on success |
| the callback function to each one. | the callback function to each one. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$array'' | ''array'' | //required// | An array to run through the callback function | | | ''$array'' | ''array'' | //required// | An array to run through the callback function | |
| | ''$callback'' | ''(untyped)'' | //required// | Callback function to run for each element in each array | | | ''$callback'' | ''(untyped)'' | //required// | Callback function to run for each element in each array | |
| | ''$on_nonscalar'' | ''(untyped)'' | ''false'' | Whether or not to call the callback function on nonscalar values (Objects, resources, etc) | | | ''$on_nonscalar'' | ''(untyped)'' | ''false'' | Whether or not to call the callback function on nonscalar values (Objects, resources, etc) | |
| |
| **Returns:** ''(none declared)'' — array | **Returns:** ''(none declared)'' — array |
| //lines 2318–2321 (4)// | //lines 2318–2321 (4)// |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$array'' | ''array'' | //required// | //none// | | | ''$array'' | ''array'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| extension installed. | extension installed. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$encoding'' | ''(untyped)'' | ''null'' | //none// | | | ''$encoding'' | ''(untyped)'' | ''null'' | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| running PHP to write to it. | running PHP to write to it. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$filename'' | ''(untyped)'' | //required// | The filename to set the writable bit on | | | ''$filename'' | ''(untyped)'' | //required// | The filename to set the writable bit on | |
| | ''$writable'' | ''(untyped)'' | ''true'' | Whether to make the file writable or not | | | ''$writable'' | ''(untyped)'' | ''true'' | Whether to make the file writable or not | |
| |
| **Returns:** ''(none declared)'' — boolean | **Returns:** ''(none declared)'' — boolean |
| running PHP to read to it. | running PHP to read to it. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$filename'' | ''(untyped)'' | //required// | The filename to set the readable bit on | | | ''$filename'' | ''(untyped)'' | //required// | The filename to set the readable bit on | |
| | ''$readable'' | ''(untyped)'' | ''true'' | Whether to make the file readable or not | | | ''$readable'' | ''(untyped)'' | ''true'' | Whether to make the file readable or not | |
| |
| **Returns:** ''(none declared)'' — boolean | **Returns:** ''(none declared)'' — boolean |
| user running PHP to read to it. | user running PHP to read to it. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$filename'' | ''(untyped)'' | //required// | The filename to set the executable bit on | | | ''$filename'' | ''(untyped)'' | //required// | The filename to set the executable bit on | |
| | ''$executable'' | ''(untyped)'' | ''true'' | Whether to make the file executable or not | | | ''$executable'' | ''(untyped)'' | ''true'' | Whether to make the file executable or not | |
| |
| **Returns:** ''(none declared)'' — boolean | **Returns:** ''(none declared)'' — boolean |
| Returns size of a given directory in bytes. | Returns size of a given directory in bytes. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$dir'' | ''(untyped)'' | //required// | //none// | | | ''$dir'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — integer | **Returns:** ''(none declared)'' — integer |
| Returns all paths inside a directory. | Returns all paths inside a directory. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$dir'' | ''(untyped)'' | //required// | //none// | | | ''$dir'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — array | **Returns:** ''(none declared)'' — array |