From 1249e50102e0705732a5eccda0bf8df4793e03cb Mon Sep 17 00:00:00 2001 From: Jeroen van Wolffelaar Date: Sun, 26 Aug 2001 22:41:56 +0000 Subject: [PATCH] More WS git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@56012 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/strings.xml | 168 +++++++++++++++++++++--------------------- 1 file changed, 84 insertions(+), 84 deletions(-) diff --git a/functions/strings.xml b/functions/strings.xml index 48a52f201b..b151960731 100644 --- a/functions/strings.xml +++ b/functions/strings.xml @@ -1,5 +1,5 @@ - + String functions Strings @@ -279,32 +279,32 @@ $new_string = chunk_split(base64_encode($data)); - k - koi8-r + k - koi8-r - w - windows-1251 + w - windows-1251 - i - iso8859-5 + i - iso8859-5 - a - x-cp866 + a - x-cp866 - d - x-cp866 + d - x-cp866 - m - x-mac-cyrillic + m - x-mac-cyrillic @@ -341,30 +341,30 @@ $new_string = chunk_split(base64_encode($data)); - 0 - an array with the byte-value as key and the frequency of - every byte as value. + 0 - an array with the byte-value as key and the frequency of + every byte as value. - 1 - same as 0 but only byte-values with a frequency greater - than zero are listed. + 1 - same as 0 but only byte-values with a frequency greater + than zero are listed. - 2 - same as 0 but only byte-values with a frequency equal to - zero are listed. + 2 - same as 0 but only byte-values with a frequency equal to + zero are listed. - 3 - a string containing all used byte-values is returned. + 3 - a string containing all used byte-values is returned. - 4 - a string containing all not used byte-values is returned. + 4 - a string containing all not used byte-values is returned. @@ -447,7 +447,7 @@ $new_string = chunk_split(base64_encode($data)); salt is generated once. If you are calling this function recursively, this may impact both appearance and, to a certain extent, security. - + The standard DES encryption crypt contains the salt as the first two characters of the output. @@ -560,7 +560,7 @@ echo $some_var ? 'true': 'false'; // changing the statement around I have <?=$foo?> foo. - + See also: print, @@ -582,7 +582,7 @@ I have <?=$foo?> foo. array explode string separator string string - int + int limit @@ -1017,7 +1017,7 @@ $colon_separated = implode(":", $array); levenshtein - Calculate Levenshtein distance between two strings + Calculate Levenshtein distance between two strings @@ -1059,7 +1059,7 @@ $colon_separated = implode(":", $array); length of str1 and str2 (rather good when compared to similar_text, which is O(max(n,m)**3), - but still expensive). + but still expensive). In its simplest form the function will take only the two @@ -1085,37 +1085,37 @@ $colon_separated = implode(":", $array); - operation to apply: 'I', 'R' or 'D' + operation to apply: 'I', 'R' or 'D' - actual character in string 1 + actual character in string 1 - actual character in string 2 + actual character in string 2 - position in string 1 + position in string 1 - position in string 2 + position in string 2 - remaining characters in string 1 + remaining characters in string 1 - remaining characters in string 2 + remaining characters in string 2 @@ -1179,76 +1179,76 @@ $colon_separated = implode(":", $array); Thousands separator - grouping - Array containing numeric groupings + grouping + Array containing numeric groupings - int_curr_symbol - International currency symbol (i.e. USD) + int_curr_symbol + International currency symbol (i.e. USD) - currency_symbol - Local currency symbol (i.e. $) + currency_symbol + Local currency symbol (i.e. $) - mon_decimal_point - Monetary decimal point character + mon_decimal_point + Monetary decimal point character - mon_thousands_sep - Monetary thousands separator + mon_thousands_sep + Monetary thousands separator - mon_grouping - Array containing monetary groupings + mon_grouping + Array containing monetary groupings - positive_sign - Sign for positive values + positive_sign + Sign for positive values - negative_sign - Sign for negative values + negative_sign + Sign for negative values - int_frac_digits - International fractional digits + int_frac_digits + International fractional digits - frac_digits - Local fractional digits + frac_digits + Local fractional digits - p_cs_precedes - - &true; if currency_symbol precedes a positive value, &false; - if it succeeds one - + p_cs_precedes + + &true; if currency_symbol precedes a positive value, &false; + if it succeeds one + - p_sep_by_space - - &true; if a space separates currency_symbol from a positive - value, &false; otherwise - + p_sep_by_space + + &true; if a space separates currency_symbol from a positive + value, &false; otherwise + - n_cs_precedes - - &true; if currency_symbol precedes a negative value, &false; - if it succeeds one - + n_cs_precedes + + &true; if currency_symbol precedes a negative value, &false; + if it succeeds one + - n_sep_by_space - - &true; if a space separates currency_symbol from a negative - value, &false; otherwise - + n_sep_by_space + + &true; if a space separates currency_symbol from a negative + value, &false; otherwise + - p_sign_posn - + p_sign_posn + @@ -2216,7 +2216,7 @@ printf($format,$num,$location); Argument swapping -$format = "The %2\$s contains %1\$d monkeys. +$format = "The %2\$s contains %1\$d monkeys. That's a nice %2\$s full of %1\$d monkeys."; printf($format, $num, $location); @@ -2864,7 +2864,7 @@ print str_pad($input, 10, "_", STR_PAD_BOTH); // produces "__Alien___" position 0" and "character not found". Here's how to detect the difference: - + // in PHP 4.0b3 and newer: $pos = strpos($mystring, "b"); if ($pos === false) { // note: three equal signs @@ -2876,7 +2876,7 @@ $pos = strpos($mystring, "b"); if (is_string($pos) && !$pos) { // not found... } - + @@ -3037,7 +3037,7 @@ echo str_repeat("-=", 10); position 0" and "character not found". Here's how to detect the difference: - + // in PHP 4.0b3 and newer: $pos = strrpos($mystring, "b"); if ($pos === false) { // note: three equal signs @@ -3049,7 +3049,7 @@ $pos = strrpos($mystring, "b"); if (is_string($pos) && !$pos) { // not found... } - + @@ -3232,7 +3232,7 @@ while ($tok) { <function>strtolower</function> example $str = "Mary Had A Little Lamb and She LOVED It So"; -$str = strtolower($str); +$str = strtolower($str); print $str; # Prints mary had a little lamb and she loved it so @@ -3269,7 +3269,7 @@ print $str; # Prints mary had a little lamb and she loved it so <function>strtoupper</function> example $str = "Mary Had A Little Lamb and She LOVED It So"; -$str = strtoupper($str); +$str = strtoupper($str); print $str; # Prints MARY HAD A LITTLE LAMB AND SHE LOVED IT SO @@ -3458,7 +3458,7 @@ $rest = substr("abcdef", 1, 3); // returns "bcd" If start is negative, the returned string will start at the start'th character - from the end of string. + from the end of string. Examples: @@ -3530,7 +3530,7 @@ print substr_count("This is a test", "is"); // prints out 2 - + substr_replace @@ -3559,12 +3559,12 @@ print substr_count("This is a test", "is"); // prints out 2 If start is positive, the replacing will begin at the start'th offset into - string. + string. If start is negative, the replacing will begin at the start'th character from the - end of string. + end of string. If length is given and is positive, it @@ -3743,7 +3743,7 @@ $clean = trim($binary,"\0x00..\0x1F"); (ä) will not be converted. <function>ucfirst</function> example - + $text = 'mary had a little lamb and she loved it so.'; $text = ucfirst($text); // $text is now Mary had a little lamb // and she loved it so. @@ -3839,9 +3839,9 @@ $text = ucwords($text); // $text is now: Mary Had A Little If the cut is set to 1, the string is - always wrapped at the specified width. So if you have a word - that is larger than the given width, it is broken apart. - (See second example). + always wrapped at the specified width. So if you have a word + that is larger than the given width, it is broken apart. + (See second example). The cut parameter was added in PHP 4.0.3.