Via Hacker News, this Chrome for Developers post dives into browser colors beyond RGB.
h2. Compatibility
The plugin works on both EE v1.x and v2.x.
h2. Installation
h4. EE v1.x
Place the _pi.phpstringfun.php_ file in the _/system/plugins_ directory.
h4. EE v2.x
Create in the _/system/expressionengine/third_party_ directory a directory _/phpstringfun_, then place the _pi.phpstringfun.php_ file in there.
h2. Parameters
h4. array_index
If the function's result is an array, such as explode, the array_index parameter allows you to set which result from the array to produce. Also see the separator parameter.
h4. function (required)
PHPStringFun requires the "function" parameter to be a PHP string function. Some functions cannot be used. These are fprintf() and implode().
Those that can be used are: addcslashes, bin2hex, chop, chr, chunk_split, convert_cyr_string, convert_uudecode, convert_uuencode, count_chars, crc32, crypt, echo, explode, get_html_translation_table, hebrev, hebrevc, html_entity_decode, htmlentities, htmlspecialchars_decode, htmlspecialchars, join, levenshtein, localeconv, ltrim, md5_file, md5, metaphone, money_format, nl_langinfo, nl2br, number_format, ord, parse_str, print, printf, quoted_printable_decode, quotemeta, rtrim, setlocale, sha1_file, sha1, similar_text, soundex, sprintf, sscanf, str_ireplace, str_pad, str_repeat, str_replace, str_rot13, str_shuffle, str_split, str_word_count, strcasecmp, strchr, strcmp, strcoll, strcspn, strip_tags, stripcslashes, stripos, stripslashes, stristr, strlen, strnatcasecmp, strnatcmp, strncasecmp, strncmp, strpbrk, strpos, strrchr, strrev, strripos, strrpos, strspn, strstr, strtok, strtolower, strtoupper, strtr, substr_compare, substr_count, substr_replace, substr, trim, ucfirst, ucwords, urlencode, vfprintf, vprintf, vsprintf, wordwrap.
h4. reverse
Some functions work better if the order that the plugin accepts parameters is reversed. For instance, the explode function works better when reverse is set to "yes", allowing the delimiter to be set as a parameter and the string to come within the body of the plugin.
h4. par1, part2, par3, par4 and par5
What comes between the tags is essentially the initial parameter. Phpstringfun accepts up to five additional parameters (par1, part2, par3, par4 and par5) needed by the chosen PHP string function. These parameters must be in sequence, so that if there's a par2 there must also be a par1.
To know how many parameters the function takes, see its PHP documentation.
h4. separator
If the output of the plugin is an array, the separator parameter lets you set which character separates the items in the array. Also see the array_index parameter.
h2. Examples
For example:
{exp:phpstringfun function="rtrim" par1="st"}test{/exp:phpstringfun}
would return "te".
{exp:phpstringfun function="explode" par1="," separator="|" reverse="y"}one,and.two,and,three{/exp:phpstringfun}
would return "one|and.two|and|three|" while
{exp:phpstringfun function="explode" par1="," array_index="2" reverse="y"}one,and.two,and,three{/exp:phpstringfun}
would return "and".
h2. Thanks
Thanks to Derek Jones for making me clean up the (rather sparse) code and Ingmar Greil and Mark Bowen for giving it lovin' on the forums.