[PHP-DOC] cvs: phpdoc /en/functions strings.xml
derek Sat Dec 20 21:58:42 2003 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: undoing changes Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.174 phpdoc/en/functions/strings.xml:1.175 --- phpdoc/en/functions/strings.xml:1.174 Sat Dec 20 19:13:10 2003 +++ phpdoc/en/functions/strings.xml Sat Dec 20 21:58:42 2003 @@ -8,7 +8,7 @@ instead --> - + String functions Strings @@ -558,15 +558,11 @@ echo $foo; // foobar echo $foo,$bar; // foobarbarbaz -// Some people prefer passing multiple parameters to echo over concatenation. -echo 'This ', 'string ', 'was ', 'made ', 'with multiple parameters.', chr(10); -echo 'This ' . 'string ' . 'was ' . 'made ' . 'with concatenation.' . "\n"; - echo <<
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
derek Sat Dec 20 19:13:11 2003 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: additional example and punctuation fix Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.173 phpdoc/en/functions/strings.xml:1.174 --- phpdoc/en/functions/strings.xml:1.173 Wed May 7 17:31:30 2003 +++ phpdoc/en/functions/strings.xml Sat Dec 20 19:13:10 2003 @@ -8,7 +8,7 @@ instead --> - + String functions Strings @@ -558,11 +558,15 @@ echo $foo; // foobar echo $foo,$bar; // foobarbarbaz +// Some people prefer passing multiple parameters to echo over concatenation. +echo 'This ', 'string ', 'was ', 'made ', 'with multiple parameters.', chr(10); +echo 'This ' . 'string ' . 'was ' . 'made ' . 'with concatenation.' . "\n"; + echo <<
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
derick Sat May 11 03:02:29 2002 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: - Fix print documentation Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.171 phpdoc/en/functions/strings.xml:1.172 --- phpdoc/en/functions/strings.xml:1.171 Wed Apr 17 15:58:45 2002 +++ phpdoc/en/functions/strings.xml Sat May 11 03:02:28 2002 @@ -8,7 +8,7 @@ instead --> - + String functions Strings @@ -1696,10 +1696,10 @@ print is not actually a real function (it is a - language construct) so you are not required to use parentheses - with it. But print, opposed to - echo, can be called using a - variable function. + language construct) so you are not required to use parentheses with it. + This also means that you can not use print (just + like echo) as a variable function. print examples
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
sander Wed Apr 3 06:21:57 2002 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Removed note from str_replace() and two minor whitespace fixes. Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.169 phpdoc/en/functions/strings.xml:1.170 --- phpdoc/en/functions/strings.xml:1.169 Thu Mar 28 12:04:23 2002 +++ phpdoc/en/functions/strings.xml Wed Apr 3 06:21:56 2002 @@ -1,5 +1,5 @@ - + String functions Strings @@ -3451,14 +3451,13 @@ replace are arrays, then str_replace takes a value from each array and uses them to do search and replace on - subject. If + subject. If replace has fewer values than search, then an empty string is used for - the rest of replacement values. If search + the rest of replacement values. If search is an array and replace is a string; then this replacement string is used for every value of - search. The converse would not make - sense, though. + search.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
sander Thu Mar 28 12:04:24 2002 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Sorted string functions. Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.168 phpdoc/en/functions/strings.xml:1.169 --- phpdoc/en/functions/strings.xml:1.168 Thu Mar 28 11:38:17 2002 +++ phpdoc/en/functions/strings.xml Thu Mar 28 12:04:23 2002 @@ -1,5 +1,5 @@ - + String functions Strings @@ -1537,6 +1537,25 @@ + + + +nl_langinfo + + Query language and locale information + + + +Description + + stringnl_langinfo + intitem + + + &warn.undocumented.func; + + + @@ -4066,25 +4085,6 @@ See also nl2br. - - - - - - -nl_langinfo - - Query language and locale information - - - -Description - - stringnl_langinfo - intitem - - - &warn.undocumented.func;
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
cortesi Sun Mar 24 19:43:51 2002 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: going in direction of RFC 2606 Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.166 phpdoc/en/functions/strings.xml:1.167 --- phpdoc/en/functions/strings.xml:1.166 Thu Mar 14 20:48:32 2002 +++ phpdoc/en/functions/strings.xml Sun Mar 24 19:43:51 2002 @@ -1,5 +1,5 @@ - + String functions Strings @@ -3205,9 +3205,9 @@ strstr example
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
torben Thu Mar 14 20:48:32 2002 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Fixed example typo in strtok(). Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.165 phpdoc/en/functions/strings.xml:1.166 --- phpdoc/en/functions/strings.xml:1.165 Tue Mar 5 06:25:00 2002 +++ phpdoc/en/functions/strings.xml Thu Mar 14 20:48:32 2002 @@ -1,5 +1,5 @@ - + String functions Strings @@ -3249,7 +3249,7 @@ $tok = strtok($string," \n\t"); while ($tok) { echo "Word=$tok"; -$tok = strtok(" "); +$tok = strtok(" \n\t"); } ]]>
[PHP-DOC] cvs: phpdoc /en/functions strings.xml /en/language functions.xml
hholzgraTue Mar 5 06:25:00 2002 EDT Modified files: /phpdoc/en/language functions.xml /phpdoc/en/functionsstrings.xml Log: trying to explain some consequences of the differences between language constructs "echo" and "print" Index: phpdoc/en/language/functions.xml diff -u phpdoc/en/language/functions.xml:1.24 phpdoc/en/language/functions.xml:1.25 --- phpdoc/en/language/functions.xml:1.24 Mon Jan 21 04:25:23 2002 +++ phpdoc/en/language/functions.xmlTue Mar 5 06:24:59 2002 @@ -1,5 +1,5 @@ - + Functions @@ -332,11 +332,12 @@ be used to implement callbacks, function tables, and so forth. -Variable functions won't work with language constructs such as +Variable functions won't work with language constructs other +than print, such as echo, unset, -isset and empty. This is -one of the major differences between PHP functions and language -constructs. +isset and empty. +This is one of the major differences between PHP functions +and languageconstructs. Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.164 phpdoc/en/functions/strings.xml:1.165 --- phpdoc/en/functions/strings.xml:1.164 Wed Feb 27 17:09:11 2002 +++ phpdoc/en/functions/strings.xml Tue Mar 5 06:25:00 2002 @@ -1,5 +1,5 @@ - + String functions Strings @@ -518,6 +518,9 @@ language construct) so you are not required to use parentheses with it. In fact, if you want to pass more than one parameter to echo, you must not enclose the parameters within parentheses. + It is not possible to use echo in a + variable function + context, but you can use print instead. echo examples @@ -1657,9 +1660,11 @@ Outputs arg. &return.success; - print is not actually a function (it is a + print is not actually a real function (it is a language construct) so you are not required to use parentheses - with it. + with it. But print, opposed to + echo, can be called using a + variable function. print examples
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
alindeman Wed Feb 27 17:09:12 2002 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: fixing error in second example Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.163 phpdoc/en/functions/strings.xml:1.164 --- phpdoc/en/functions/strings.xml:1.163 Sun Feb 24 07:35:30 2002 +++ phpdoc/en/functions/strings.xml Wed Feb 27 17:09:11 2002 @@ -1,5 +1,5 @@ - + String functions Strings @@ -702,7 +702,7 @@
[PHP-DOC] cvs: phpdoc /en/functions strings.xml swf.xml
nohnSun Feb 24 07:35:31 2002 EDT Modified files: /phpdoc/en/functionsstrings.xml swf.xml Log: Fixes some issues described in Bug #14219 Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.162 phpdoc/en/functions/strings.xml:1.163 --- phpdoc/en/functions/strings.xml:1.162 Thu Feb 21 13:21:47 2002 +++ phpdoc/en/functions/strings.xml Sun Feb 24 07:35:30 2002 @@ -1,5 +1,5 @@ - + String functions Strings @@ -16,6 +16,12 @@ the Strings entry in the Types section of the manual. + + +For even more powerful string handling and manipulating functions +take a look at the POSIX regular +expression functions and the Perl +compatible regular expression functions Index: phpdoc/en/functions/swf.xml diff -u phpdoc/en/functions/swf.xml:1.28 phpdoc/en/functions/swf.xml:1.29 --- phpdoc/en/functions/swf.xml:1.28Wed Feb 13 21:44:51 2002 +++ phpdoc/en/functions/swf.xml Sun Feb 24 07:35:31 2002 @@ -1,5 +1,5 @@ - + Shockwave Flash functions SWF @@ -84,6 +84,10 @@ The libswf does not have support for Windows. The development of that library has been stopped, and the source is not available to port it to another systems. + + + For up to date SWF support take a look at the + MING functions.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
imajes Thu Feb 21 13:21:52 2002 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: typo error for print function example. Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.161 phpdoc/en/functions/strings.xml:1.162 --- phpdoc/en/functions/strings.xml:1.161 Tue Feb 12 04:13:12 2002 +++ phpdoc/en/functions/strings.xml Thu Feb 21 13:21:47 2002 @@ -1,5 +1,5 @@ - + String functions Strings @@ -1670,7 +1670,7 @@ print "This spans\nmultiple lines. The newlines will be\noutput as well."; -print "escaping characters is done \"Like this\"." +print "escaping characters is done \"Like this\"."; // You can use variables inside of an print statement $foo = "foobar";
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
yohgaki Tue Feb 12 04:13:33 2002 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Clarify strstr() description a little Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.160 phpdoc/en/functions/strings.xml:1.161 --- phpdoc/en/functions/strings.xml:1.160 Fri Feb 8 09:12:05 2002 +++ phpdoc/en/functions/strings.xml Tue Feb 12 04:13:12 2002 @@ -1,5 +1,5 @@ - + String functions Strings @@ -3172,8 +3172,9 @@ stringneedle - Returns all of haystack from the first - occurrence of needle to the end. + Returns part of haystack string from the + first occurrence of needle to the end of + haystack. If needle is not found, returns &false;.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
hholzgraFri Feb 8 06:25:52 2002 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: added 2nd prototype variant for strtr() Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.158 phpdoc/en/functions/strings.xml:1.159 --- phpdoc/en/functions/strings.xml:1.158 Sat Feb 2 10:36:09 2002 +++ phpdoc/en/functions/strings.xml Fri Feb 8 06:25:51 2002 @@ -1,5 +1,5 @@ - + String functions Strings @@ -3461,6 +3461,11 @@ stringstr stringfrom stringto + + + stringstrtr + stringstr + +arrayreplace_pairs This function returns a copy of str,
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
yohgaki Wed Jan 23 23:11:01 2002 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Added "See also pack/unpack" for bin2hex. Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.155 phpdoc/en/functions/strings.xml:1.156 --- phpdoc/en/functions/strings.xml:1.155 Tue Jan 15 05:38:35 2002 +++ phpdoc/en/functions/strings.xml Wed Jan 23 23:11:00 2002 @@ -1,5 +1,5 @@ - + String functions Strings @@ -150,6 +150,9 @@ Returns an ASCII string containing the hexadecimal representation of str. The conversion is done byte-wise with the high-nibble first. + + + See also pack and unpack.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
derick Sun Jan 13 16:23:51 2002 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: - Document print to be a language construct Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.153 phpdoc/en/functions/strings.xml:1.154 --- phpdoc/en/functions/strings.xml:1.153 Sat Jan 12 18:32:00 2002 +++ phpdoc/en/functions/strings.xml Sun Jan 13 16:23:51 2002 @@ -1,5 +1,5 @@ - + String functions Strings @@ -1744,6 +1744,11 @@ Outputs arg. &return.success; + + print is not actually a function (it is a + language construct) so you are not required to use parentheses + with it. + print examples @@ -1761,7 +1766,7 @@ print "escaping characters is done \"Like this\"." -//You can use variables inside of an print statement +// You can use variables inside of an print statement $foo = "foobar"; $bar = "barbaz";
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
irc-htmlSat Jan 12 18:32:01 2002 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: bug #14935: example for addcslashes Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.152 phpdoc/en/functions/strings.xml:1.153 --- phpdoc/en/functions/strings.xml:1.152 Wed Jan 9 21:11:28 2002 +++ phpdoc/en/functions/strings.xml Sat Jan 12 18:32:00 2002 @@ -1,5 +1,5 @@ - + String functions Strings @@ -67,9 +67,11 @@ @@ -82,10 +84,7 @@
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
irc-htmlWed Jan 9 21:11:29 2002 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: addcslashes: doc bug #14935 Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.151 phpdoc/en/functions/strings.xml:1.152 --- phpdoc/en/functions/strings.xml:1.151 Fri Jan 4 20:03:24 2002 +++ phpdoc/en/functions/strings.xml Wed Jan 9 21:11:28 2002 @@ -1,5 +1,5 @@ - + String functions Strings @@ -69,7 +69,7 @@
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
zak Fri Jan 4 20:03:26 2002 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Extended strtok documentation to include information about multiple tokens Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.150 phpdoc/en/functions/strings.xml:1.151 --- phpdoc/en/functions/strings.xml:1.150 Wed Jan 2 07:26:33 2002 +++ phpdoc/en/functions/strings.xml Fri Jan 4 20:03:24 2002 @@ -1,5 +1,5 @@ - + String functions Strings @@ -3386,16 +3386,19 @@ - strtok is used to tokenize a string. That - is, if you have a string like "This is an example string" you + strtok splits a string (arg1) + into smaller strings (tokens), with each token being delimited by any + character from arg2. + That is, if you have a string like "This is an example string" you could tokenize this string into its individual words by using the space character as the token. strtok example
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jimwWed Jan 2 07:26:33 2002 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: chunk_split: one more prose tweak, fix see also of wordwrap Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.149 phpdoc/en/functions/strings.xml:1.150 --- phpdoc/en/functions/strings.xml:1.149 Wed Jan 2 07:24:47 2002 +++ phpdoc/en/functions/strings.xml Wed Jan 2 07:26:33 2002 @@ -1,5 +1,5 @@ - + String functions Strings @@ -240,8 +240,8 @@ e.g. converting base64_encode output to match RFC 2045 semantics. It inserts end (defaults to - "\r\n") every chunklen (defaults to 76) chars. It - returns the new string leaving the original string untouched. + "\r\n") every chunklen characters (defaults to + 76). It returns the new string leaving the original string untouched. chunk_split example @@ -255,7 +255,7 @@ See also explode, split - and word_wrap. + and wordwrap.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jimwWed Jan 2 07:24:48 2002 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: chunk_split: don't give parameter same name as type, fix prose a little Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.148 phpdoc/en/functions/strings.xml:1.149 --- phpdoc/en/functions/strings.xml:1.148 Wed Jan 2 06:54:08 2002 +++ phpdoc/en/functions/strings.xml Wed Jan 2 07:24:47 2002 @@ -1,5 +1,5 @@ - + String functions Strings @@ -226,7 +226,7 @@ string chunk_split - string string + string body int chunklen @@ -236,13 +236,12 @@ - Can be used to split a string into smaller chunks which is useful - for e.g. converting base64_encode output to - match RFC 2045 semantics. It inserts every - chunklen (defaults to 76) chars the string - end (defaults to "\r\n"). It returns the - new string leaving the original string untouched. + Can be used to split a string into smaller chunks which is useful for + e.g. converting base64_encode output to match RFC + 2045 semantics. It inserts end (defaults to + "\r\n") every chunklen (defaults to 76) chars. It + returns the new string leaving the original string untouched. chunk_split example
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jimwWed Jan 2 06:54:08 2002 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: str_repeat: see also substr_count Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.147 phpdoc/en/functions/strings.xml:1.148 --- phpdoc/en/functions/strings.xml:1.147 Tue Jan 1 17:56:13 2002 +++ phpdoc/en/functions/strings.xml Wed Jan 2 06:54:08 2002 @@ -1,5 +1,5 @@ - + String functions Strings @@ -3182,6 +3182,9 @@ This will output "-=-=-=-=-=-=-=-=-=-=". + + + See also substr_count.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
philip Tue Jan 1 17:56:14 2002 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Notes: Removed unneeded ones, modifed a few others. We don't need a note to declare when a function came into existence. chunk_split: See also explode, split and wordwrap Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.146 phpdoc/en/functions/strings.xml:1.147 --- phpdoc/en/functions/strings.xml:1.146 Sun Dec 30 03:50:53 2001 +++ phpdoc/en/functions/strings.xml Tue Jan 1 17:56:13 2002 @@ -1,5 +1,5 @@ - + String functions Strings @@ -89,10 +89,6 @@ ]]> - - - Added in PHP 4 - See also stripcslashes, @@ -257,14 +253,11 @@ ]]> - This function is significantly faster than - ereg_replace. - - - This function was added in 3.0.6. - - + + See also explode, split + and word_wrap. + @@ -384,11 +377,6 @@ - - - This function was added in PHP 4.0. - - @@ -1422,11 +1410,6 @@ The constant CHAR_MAX is also defined for the use mentioned above. - - - Added in PHP 4.0.5 - - See also: setlocale. @@ -2616,11 +2599,6 @@ Note that this comparison is case sensitive, and unlike strcmp this function is not binary safe. - - - Added in PHP 4.0.5. - - See also ereg, strcmp, strcasecmp, substr, @@ -2732,11 +2710,6 @@ Returns a string with backslashes stripped off. Recognizes C-like \n, \r ..., octal and hexadecimal representation. - - - Added in PHP4b3-dev. - - See also addcslashes. @@ -3210,11 +3183,6 @@ This will output "-=-=-=-=-=-=-=-=-=-=". - - - This function was added in PHP 4.0. - - @@ -3702,7 +3670,8 @@ - This feature (two arguments) was added in PHP 4.0. + This optional to and + from parameters were added in PHP 4.0.0 @@ -3910,11 +3879,6 @@ See also str_replace and substr. - - - substr_replace was added in PHP 4.0. - - @@ -3943,7 +3907,8 @@ - The second parameter was added in PHP 4.1.0 + The optional charlist parameter was + added in PHP 4.1.0 @@ -4222,7 +4187,7 @@ (See second example). - The cut parameter was added in PHP 4.0.3. + The optional cut parameter was added in PHP 4.0.3
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
georg Sun Dec 30 03:50:53 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: fixed bug 14761 (typo) Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.145 phpdoc/en/functions/strings.xml:1.146 --- phpdoc/en/functions/strings.xml:1.145 Thu Dec 20 18:05:09 2001 +++ phpdoc/en/functions/strings.xml Sun Dec 30 03:50:53 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -1513,7 +1513,7 @@ .. you can specify a range of characters. - Usuage example of ltrim + Usage example of ltrim
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jimwThu Dec 20 18:05:10 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: substr: fix examples and explanations related to negative starts and lengths, clean up layout Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.144 phpdoc/en/functions/strings.xml:1.145 --- phpdoc/en/functions/strings.xml:1.144 Thu Dec 20 17:38:53 2001 +++ phpdoc/en/functions/strings.xml Thu Dec 20 18:05:09 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -3742,59 +3742,58 @@ character at position 2 is 'c', and so forth. - - Examples: - - + + Basic substr usage + - - - + + If start is negative, the returned string will start at the start'th character from the end of string. - - Examples: - - + + Using a negative start + - - - + + - If length is given and is positive, the - string returned will end length characters - from start. If this would result in a - string with negative length (because the start is past the end of - the string), then the returned string will contain the single - character at start. + If length is given and is positive, the string + returned will contain at most length characters + beginning from start (depending on the length of + string. If string is less + than start characters long, &false; will be + returned. - If length is given and is negative, the - string returned will end length characters - from the end of string. If this would - result in a string with negative length, then the returned string - will contain the single character at - start. + If length is given and is negative, then that many + characters will be omitted from the end of string + (after the start position has been calculated when a + start is negative). If + start denotes a position beyond this truncation, + an empty string will be returned. - - Examples: - - + + Using a negative length + - - - + + See also strrchr and ereg.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jimwThu Dec 20 17:38:53 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: strstr: update see also list Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.143 phpdoc/en/functions/strings.xml:1.144 --- phpdoc/en/functions/strings.xml:1.143 Mon Dec 17 17:29:42 2001 +++ phpdoc/en/functions/strings.xml Thu Dec 20 17:38:53 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -3374,14 +3374,12 @@ If needle is not a string, it is converted to an integer and applied as the ordinal value of a character. - - - - Note that this function is case-sensitive. For - case-insensitive searches, use stristr. - - - + + + This function is case-sensitive. For case-insensitive searches, use + stristr. + + strstr example @@ -3395,9 +3393,10 @@ - See also strchr, stristr, - strrchr, substr, and - ereg. + See also ereg, preg_match, + strchr, stristr, + strpos, strrchr, and + substr.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jimwMon Dec 17 17:29:42 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: htmlentites,htmlspecialchars: document version third argument was added Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.142 phpdoc/en/functions/strings.xml:1.143 --- phpdoc/en/functions/strings.xml:1.142 Mon Dec 17 14:49:37 2001 +++ phpdoc/en/functions/strings.xml Mon Dec 17 17:29:42 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -754,11 +754,6 @@ The content of $original would be: "Hallo && Krämer". - - - This function was added in PHP 4.0. - - See also: htmlspecialchars, @@ -914,12 +909,13 @@ At present, the ISO-8859-1 character set is used as default. - Note that the optional second argument was added in PHP 3.0.17 - and PHP 4.0.3. + Support for the optional second argument was added in PHP 3.0.17 and PHP + 4.0.3. Like htmlspecialchars, it takes an optional third argument which defines character set used in conversion. + Support for this argument was added in PHP 4.1.0. See also htmlspecialchars and @@ -1012,12 +1008,13 @@ Note that this function does not translate anything beyond what is listed above. For full entity translation, see - htmlentities. Also note that the optional + htmlentities. Support for the optional second argument was added in PHP 3.0.17 and PHP 4.0.3. The third argument defines character set used in conversion. The - default character set is ISO-8859-1. + default character set is ISO-8859-1. Support for this third argument was + added in PHP 4.1.0. See also htmlentities and
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
hholzgraMon Dec 17 14:49:49 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: added skeleton for missing function Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.141 phpdoc/en/functions/strings.xml:1.142 --- phpdoc/en/functions/strings.xml:1.141 Sun Dec 16 15:38:08 2001 +++ phpdoc/en/functions/strings.xml Mon Dec 17 14:49:37 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -4291,6 +4291,26 @@ + + +nl_langinfo + + Query language and locale information + + + +Description + + + string nl_langinfo + int item + + + + &warn.undocumented.func; + + +
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jimwSun Dec 16 15:38:10 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: crypt: clarify a bit, add examples, resist urge to replace all uses of 'encryption' with 'hashing' Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.140 phpdoc/en/functions/strings.xml:1.141 --- phpdoc/en/functions/strings.xml:1.140 Sun Dec 16 05:34:01 2001 +++ phpdoc/en/functions/strings.xml Sun Dec 16 15:38:08 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -419,7 +419,7 @@ crypt -DES-encrypt a string +One-way string encryption (hashing) Description @@ -434,38 +434,40 @@ crypt will return an encrypted string using the - standard Unix DES encryption method. Arguments - are a string to be encrypted and an optional two-character salt - string to base the encryption on. See the Unix man page for your - crypt function for more information. + standard Unix DES-based encryption algorithm or + alternative algorithms that may be available on the system. Arguments + are a string to be encrypted and an optional salt string to base the + encryption on. See the Unix man page for your crypt function for more + information. If the salt argument is not provided, one will be randomly generated by PHP. - Some operating systems support more than one type of encryption. - In fact, sometimes the standard DES encryption is replaced by an - MD5 based encryption algorithm. The encryption type is triggered - by the salt argument. At install time, PHP determines the - capabilities of the crypt function and will accept salts for - other encryption types. If no salt is provided, PHP will - auto-generate a standard 2-character DES salt by default, unless - the default encryption type on the system is MD5, in which case a - random MD5-compatible salt is generated. PHP sets a constant - named CRYPT_SALT_LENGTH which tells you whether a regular - 2-character salt applies to your system or the longer 12-char MD5 - salt is applicable. + Some operating systems support more than one type of encryption. In + fact, sometimes the standard DES-based encryption is replaced by an + MD5-based encryption algorithm. The encryption type is triggered by the + salt argument. At install time, PHP determines the capabilities of the + crypt function and will accept salts for other encryption types. If no + salt is provided, PHP will auto-generate a standard two character salt by + default, unless the default encryption type on the system is MD5, in + which case a random MD5-compatible salt is generated. PHP sets a + constant named CRYPT_SALT_LENGTH which tells you whether a regular two + character salt applies to your system or the longer twelve character salt + is applicable. - If you are using the supplied salt, you should be aware that the - salt is generated once. If you are calling this function - recursively, this may impact both appearance and, to a certain - extent, security. + If you are using the supplied salt, you should be aware that the salt is + generated once. If you are calling this function recursively, this may + impact both appearance and security. - The standard DES encryption crypt contains - the salt as the first two characters of the output. + The standard DES-based encryption crypt returns the + salt as the first two characters of the output. It also only uses the + first eight characters of str, so longer strings + that start with the same eight characters will generate the same result + (when the same salt is used). On systems where the crypt() function supports multiple @@ -475,33 +477,54 @@ - CRYPT_STD_DES - Standard DES encryption with a 2-char SALT + CRYPT_STD_DES - Standard DES-based encryption with a two character salt - CRYPT_EXT_DES - Extended DES encryption with a 9-char SALT + CRYPT_EXT_DES - Extended DES-based encryption with a nine character salt - CRYPT_MD5 - MD5 encryption with a 12-char SALT starting with + CRYPT_MD5 - MD5 encryption with a twelve character salt starting with $1$ - CRYPT_BLOWFISH - Extended DES encryption with a 16-char SALT + CRYPT_BLOWFISH - Blowfish encryption with a sixteen character salt starting with $2$ + + + There is no decrypt function, since crypt + uses a one-way algorithm. + + + + crypt examples + + + + - There is no decrypt function, since crypt - uses a one-way algorithm. - - - See also: md5. + See
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
derick Sun Dec 16 05:34:01 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: - Added changed strtok behavior to the manual Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.139 phpdoc/en/functions/strings.xml:1.140 --- phpdoc/en/functions/strings.xml:1.139 Sat Dec 15 09:52:19 2001 +++ phpdoc/en/functions/strings.xml Sun Dec 16 05:34:01 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -3424,6 +3424,41 @@ multiple tokens in the token parameter. The string will be tokenized when any one of the characters in the argument are found. + + + The behavior when an empty part was found changed with PHP 4.1.0. The old + behavior returned an empty string, while the new, correct, behavior + simply skips the part of the string: + + Old strtok behavior + + + + + + New strtok behavior + + + + Also be careful that your tokens may be equal to "0". This
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
hholzgraSat Dec 15 09:52:27 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: added str_rot13 Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.138 phpdoc/en/functions/strings.xml:1.139 --- phpdoc/en/functions/strings.xml:1.138 Fri Dec 14 15:27:08 2001 +++ phpdoc/en/functions/strings.xml Sat Dec 15 09:52:19 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -1868,6 +1868,30 @@ nl2br, and stripslashes. + + + + + +str_rot13 +Perform the rot13 transform on a string + + +Description + + + string str_rot13 + string str + + + + This function performs the ROT13 encoding on the + str argument and returns the resulting + string. The ROT13 encoding simply shifts every letter by 13 + places in the alphabet while leaving non-alpha characters + untouched. Encoding and decoding are done by the same function, + passing an encoded string as argument will return the original version. +
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jimwFri Dec 14 15:27:08 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: print: &return.success;, add examples Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.137 phpdoc/en/functions/strings.xml:1.138 --- phpdoc/en/functions/strings.xml:1.137 Fri Dec 14 15:09:33 2001 +++ phpdoc/en/functions/strings.xml Fri Dec 14 15:27:08 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -1741,10 +1741,49 @@ - Outputs arg. + Outputs arg. &return.success; + + print examples + + + + - See also: echo, printf, + See also echo, printf, and flush.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jimwFri Dec 14 15:09:33 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: strpos: fix pre-4.0b3 example Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.136 phpdoc/en/functions/strings.xml:1.137 --- phpdoc/en/functions/strings.xml:1.136 Wed Dec 12 15:47:30 2001 +++ phpdoc/en/functions/strings.xml Fri Dec 14 15:09:33 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -3017,7 +3017,7 @@ // in versions older than 4.0b3: $pos = strpos($mystring, "b"); -if (is_string($pos) && !$pos) { +if (!is_integer($pos)) { // not found... } ]]>
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
derick Wed Dec 12 02:53:11 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: - Add md5_file documentation Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.134 phpdoc/en/functions/strings.xml:1.135 --- phpdoc/en/functions/strings.xml:1.134 Sat Dec 8 18:39:06 2001 +++ phpdoc/en/functions/strings.xml Wed Dec 12 02:53:11 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -1539,7 +1539,36 @@ The hash is a 32-character hexadecimal number. - See also crc32. + See also: crc32 and md5_file + + + + + + +md5_file +Calculates the md5 hash of a given filename + + +Description + + + string md5_file + string filename + + + + Calculates the MD5 hash of the specified + filename using the + RSA Data Security, Inc. + MD5 Message-Digest Algorithm, and returns that hash. + + + This function has the same purpose of the command line utility + md5sum. + + + See also: md5 and crc32
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jimwSat Dec 8 18:39:07 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: soundex: see alsos Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.133 phpdoc/en/functions/strings.xml:1.134 --- phpdoc/en/functions/strings.xml:1.133 Sat Dec 8 16:21:50 2001 +++ phpdoc/en/functions/strings.xml Sat Dec 8 18:39:06 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -1572,11 +1572,6 @@ <[EMAIL PROTECTED]>. It is described in ["Practical Algorithms for Programmers", Binstock & Rex, Addison Wesley, 1995]. - - - This function was added in PHP 4.0. - - @@ -2129,6 +2124,10 @@ ]]> + + + See also levenshtein, + metaphone, and similar_text.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jimwSat Dec 8 16:21:50 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: parse_str: incorporate user notes Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.132 phpdoc/en/functions/strings.xml:1.133 --- phpdoc/en/functions/strings.xml:1.132 Sat Dec 8 15:04:38 2001 +++ phpdoc/en/functions/strings.xml Sat Dec 8 16:21:50 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -1677,6 +1677,11 @@ the second parameter arr is present, variables are stored in this variable as an array elements instead. + + + Support for the optional second parameter was added in PHP 4.0.3. + + Using parse_str @@ -1690,6 +1695,10 @@ ]]> + + + See also set_magic_quotes_runtime + and urldecode.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jimwSat Dec 8 15:04:38 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: note length of md5 hash Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.131 phpdoc/en/functions/strings.xml:1.132 --- phpdoc/en/functions/strings.xml:1.131 Sat Dec 8 14:46:08 2001 +++ phpdoc/en/functions/strings.xml Sat Dec 8 15:04:38 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -1536,9 +1536,10 @@ Calculates the MD5 hash of str using the RSA Data Security, Inc. MD5 Message-Digest Algorithm, and returns that hash. + The hash is a 32-character hexadecimal number. - See also: crc32 + See also crc32.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jimwSat Dec 8 14:46:08 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: echo: add example using here documents Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.130 phpdoc/en/functions/strings.xml:1.131 --- phpdoc/en/functions/strings.xml:1.130 Fri Dec 7 16:27:53 2001 +++ phpdoc/en/functions/strings.xml Sat Dec 8 14:46:08 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -557,6 +557,13 @@ // If you are not using any other characters, you can just echo variables echo $foo; // foobar echo $foo,$bar; // foobarbarbaz + +echo <<
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jimwFri Dec 7 16:27:53 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: explode: add example, clean up text a little Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.129 phpdoc/en/functions/strings.xml:1.130 --- phpdoc/en/functions/strings.xml:1.129 Tue Dec 4 14:17:54 2001 +++ phpdoc/en/functions/strings.xml Fri Dec 7 16:27:53 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -612,14 +612,15 @@ boundaries formed by the string separator. If limit is set, the returned array will contain a maximum of limit elements with - the last element containing the whole rest of - string. If an empty string ("") is used - as the separator argument, then + the last element containing the rest of + string. + + + If separator is an empty string (""), explode will return &false;. If - separator contains a value that is not - contained in the string argument, - thenexplode will return the - string argument. + separator contains a value that is not contained + in string, then explode will + return an array containing string. @@ -629,11 +630,14 @@ - explode example + explode examples
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
hholzgraTue Dec 4 14:17:54 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: fixed mistyped CDATA end tag, parse_str should show up again tomorrow Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.128 phpdoc/en/functions/strings.xml:1.129 --- phpdoc/en/functions/strings.xml:1.128 Mon Dec 3 16:59:00 2001 +++ phpdoc/en/functions/strings.xml Tue Dec 4 14:17:54 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -1628,7 +1628,7 @@ if (ord($str) == 10) { echo "The first character of \$str is a line feed.\n"; } -]> +]]>
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
philip Wed Nov 21 14:13:25 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Typo fix from previous commit. Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.125 phpdoc/en/functions/strings.xml:1.126 --- phpdoc/en/functions/strings.xml:1.125 Wed Nov 21 13:39:05 2001 +++ phpdoc/en/functions/strings.xml Wed Nov 21 14:13:24 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -3789,7 +3789,7 @@ ucfirst example $foo = 'hello world!'; -$foo = ucfirst($text);// Hello world! +$foo = ucfirst($foo); // Hello world! $bar = 'HELLO WORLD!'; $bar = ucfirst($bar); // HELLO WORLD!
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
philip Wed Nov 21 13:39:06 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Expanded examples for ucwords() and ucfirst() a bit. Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.124 phpdoc/en/functions/strings.xml:1.125 --- phpdoc/en/functions/strings.xml:1.124 Mon Nov 19 08:46:48 2001 +++ phpdoc/en/functions/strings.xml Wed Nov 21 13:39:05 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -3788,15 +3788,17 @@ ucfirst 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. +$foo = 'hello world!'; +$foo = ucfirst($text);// Hello world! + +$bar = 'HELLO WORLD!'; +$bar = ucfirst($bar); // HELLO WORLD! +$bar = ucfirst(strtolower($bar)); // Hello world! - See also strtolower and - strtoupper, + See also strtolower, strtoupper, and ucwords. @@ -3824,9 +3826,12 @@ ucwords example -$text = "mary had a little lamb and she loved it so."; -$text = ucwords($text); // $text is now: Mary Had A Little -// Lamb And She Loved It So. +$foo = 'hello world!'; +$foo = ucwords($foo); // Hello World! + +$bar = 'HELLO WORLD!'; +$bar = ucwords($bar); // HELLO WORLD! +$bar = ucwords(strtolower($bar)); // Hello World!
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
zak Mon Nov 19 08:46:50 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Added terse docs for vprintf()/vsprintf(). Corrected return value for printf() Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.123 phpdoc/en/functions/strings.xml:1.124 --- phpdoc/en/functions/strings.xml:1.123 Mon Nov 12 11:50:43 2001 +++ phpdoc/en/functions/strings.xml Mon Nov 19 08:46:48 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -1682,7 +1682,7 @@ Description - int printf + void printf string format mixed args... @@ -3845,6 +3845,69 @@ + + +vprintf +Output a formatted string + + +Description + + + void vprintf + string format + array + args + + + + + Display array values as a formatted string according to + format (which is described in the documentation + for sprintf). + + + Operates as printf but accepts an array of + arguments, rather than a variable number of arguments. + + + See also: printf, sprintf, + vsprintf + + + + + + +vsprintf +Return a formatted string + + +Description + + + string vsprintf + string format + array + args + + + + + Return array values as a formatted string according to + format (which is described in the documentation + for sprintf). + + + Operates as sprintf but accepts an array of + arguments, rather than a variable number of arguments. + + + See also: sprintf, vsprintf, + vprintf + + +
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jimwThu Nov 1 17:58:31 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: add strrev() example Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.119 phpdoc/en/functions/strings.xml:1.120 --- phpdoc/en/functions/strings.xml:1.119 Tue Oct 30 19:45:52 2001 +++ phpdoc/en/functions/strings.xml Thu Nov 1 17:58:31 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -3039,6 +3039,14 @@ Returns string, reversed. + + Reversing a string with strrev + ++ +
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jimwTue Oct 30 19:45:52 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: add see also for ucwords to strtolower, strtoupper, and ucfirst Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.118 phpdoc/en/functions/strings.xml:1.119 --- phpdoc/en/functions/strings.xml:1.118 Sun Oct 28 20:51:33 2001 +++ phpdoc/en/functions/strings.xml Tue Oct 30 19:45:52 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -3275,8 +3275,9 @@ - See also strtoupper - and ucfirst. + See also strtoupper, + ucfirst, + and ucwords. @@ -3312,8 +3313,9 @@ - See also strtolower - and ucfirst. + See also strtolower, + ucfirst, + and ucwords. @@ -3789,8 +3791,9 @@ - See also strtoupper and - strtolower. + See also strtolower and + strtoupper, + and ucwords.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jimwSun Oct 28 20:51:34 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: add warning to strip_tags() about attributes being passed through, add to the example, and clean up the notice of what versions the allowable_tags param was added in. Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.117 phpdoc/en/functions/strings.xml:1.118 --- phpdoc/en/functions/strings.xml:1.117 Wed Oct 17 12:24:00 2001 +++ phpdoc/en/functions/strings.xml Sun Oct 28 20:51:33 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -2506,8 +2506,8 @@ should not be stripped. - Allowable_tags was added in PHP 3.0.13, - PHP4B3. + allowable_tags was added in PHP 3.0.13 + and PHP 4.0b3. @@ -2515,10 +2515,19 @@ strip_tags example -$string = strip_tags($string, ''); +$string = strip_tags($string, ''); + + + This function does not modify any attributes on the tags that you allow + using allowable_tags, including the + style and onmouseover attributes + that a mischievous user may abuse when posting text that will be shown + to other users. + +
[PHP-DOC] cvs: phpdoc /en/functions strings.xml /ja/chapters install.xml /ja/functions strings.xml
hirokawaThu Oct 4 09:00:01 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml /phpdoc/ja/chapters install.xml /phpdoc/ja/functionsstrings.xml Log: fixed some jade errors (deleted some old links.) Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.114 phpdoc/en/functions/strings.xml:1.115 --- phpdoc/en/functions/strings.xml:1.114 Fri Sep 21 19:21:07 2001 +++ phpdoc/en/functions/strings.xml Thu Oct 4 09:00:00 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -838,6 +838,9 @@ int quote_style + string + charset + @@ -854,8 +857,13 @@ both double and single quotes unconverted. - At present, the ISO-8859-1 character set is used. Note that the - optional second argument was added in PHP 3.0.17 and PHP 4.0.3. + At present, the ISO-8859-1 character set is used as default. + Note that the optional second argument was added in PHP 3.0.17 + and PHP 4.0.3. + + + Like htmlspecialchars, it takes an optional + third argument which defines character set used in conversion. See also htmlspecialchars and @@ -880,6 +888,9 @@ int quote_style + string + charset + @@ -945,6 +956,10 @@ is listed above. For full entity translation, see htmlentities. Also note that the optional second argument was added in PHP 3.0.17 and PHP 4.0.3. + + + The third argument defines character set used in conversion. The + default character set is ISO-8859-1. See also htmlentities and Index: phpdoc/ja/chapters/install.xml diff -u phpdoc/ja/chapters/install.xml:1.37 phpdoc/ja/chapters/install.xml:1.38 --- phpdoc/ja/chapters/install.xml:1.37 Sun Aug 12 12:37:40 2001 +++ phpdoc/ja/chapters/install.xml Thu Oct 4 09:00:00 2001 @@ -396,10 +396,7 @@ 異なる機能が必要な場合には、PHPやWebサーバを構築する必要を生じる 可能性があります。ソフトウエアの構築およびコンパイルに不慣れな場 合、必要とする機能を有するパッケージ版のPHPが既に構築されていない - かどうかを調べる価値があります。 - Lightyear Design は、 - Tenon Intersystems と同様に - OS X用にコンパイルした構築前バージョンのPHPを提供しています。 + かどうかを調べることを推奨します。 @@ -3227,12 +3224,9 @@ PWS と IIS においては、browscap.iniを 次のように指定することができます。: - Windows 9x/Me では 'c:\windows\system\inetsrv\browscap.ini' 、 - NT/2000 サーバーでは + Windows 9x/Me では 'c:\windows\system\inetsrv\browscap.ini'、 + NT/2000 サーバーでは、 'c:\winnt\system32\inetsrv\browscap.ini' - PHP における browscap 機能に関する詳細な情報については、 - この ミラーサーバー を見て、 - "source" ボタンを押して動作を確認下さい。 Index: phpdoc/ja/functions/strings.xml diff -u phpdoc/ja/functions/strings.xml:1.41 phpdoc/ja/functions/strings.xml:1.42 --- phpdoc/ja/functions/strings.xml:1.41Mon Aug 13 04:11:37 2001 +++ phpdoc/ja/functions/strings.xml Thu Oct 4 09:00:00 2001 @@ -782,6 +782,11 @@ quote_style + string + + charset + + @@ -796,7 +801,10 @@ オートを共に変換しません。 - 現在のところ、ISO-8859-1 文字セットが使われます。 + 現在のところ、ISO-8859-1 +文字セットがデフォルトの文字エンコーディ + ングとして使用されます。3番目の引数 + charsetにて他の文字エンコーディングを指定 + することも可能です。 htmlspecialchars および
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jeroen Mon Sep 17 17:33:40 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Moved note about when second parameter was added to [l|r]trim a 'bit' more to the top. Maybe we should make it a habit to place it right under the prototype? That's where it belongs IMHO... Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.110 phpdoc/en/functions/strings.xml:1.111 --- phpdoc/en/functions/strings.xml:1.110 Fri Sep 14 21:46:41 2001 +++ phpdoc/en/functions/strings.xml Mon Sep 17 17:33:40 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -1385,6 +1385,11 @@ + + + The second parameter was added in PHP 4.0.7 + + This function returns a string with whitespace stripped from the beginning of str. @@ -1457,11 +1462,6 @@ - - - The second parameter was added in PHP 4.0.7 - - See also trim and rtrim. @@ -1766,6 +1766,11 @@ + + + The second parameter was added in PHP 4.0.7 + + This function returns a string with whitespace stripped from the end of str. @@ -1838,11 +1843,6 @@ - - - The second parameter was added in PHP 4.0.7 - - See also trim and ltrim. @@ -3649,6 +3649,11 @@ + + + The second parameter was added in PHP 4.0.7 + + This function returns a string with whitespace stripped from the beginning and end of str. @@ -3721,11 +3726,6 @@ - - - The second parameter was added in PHP 4.0.7 - - See also ltrim and rtrim.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
philip Fri Sep 14 21:46:42 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Added a note saying "magic_quotes_gpc is ON by default", under addslashes description. Hopefully will encourage people to read about magic_quotes_gpc. Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.109 phpdoc/en/functions/strings.xml:1.110 --- phpdoc/en/functions/strings.xml:1.109 Thu Sep 13 03:49:58 2001 +++ phpdoc/en/functions/strings.xml Fri Sep 14 21:46:41 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -117,6 +117,11 @@ ("), backslash (\) and NUL (the &null; byte). + + + magic_quotes_gpc is ON by default. + + See also stripslashes, htmlspecialchars, and
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
philip Thu Sep 13 03:49:59 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Added example for strip_tags() Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.108 phpdoc/en/functions/strings.xml:1.109 --- phpdoc/en/functions/strings.xml:1.108 Sun Aug 26 18:41:56 2001 +++ phpdoc/en/functions/strings.xml Thu Sep 13 03:49:58 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -2489,6 +2489,14 @@ PHP4B3. + + + + strip_tags example + +$string = strip_tags($string, ''); + +
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jeroen Sun Aug 26 18:41:56 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: More WS Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.107 phpdoc/en/functions/strings.xml:1.108 --- phpdoc/en/functions/strings.xml:1.107 Sat Aug 25 20:55:53 2001 +++ phpdoc/en/functions/strings.xml Sun Aug 26 18:41:56 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -279,32 +279,32 @@ - 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 @@ - 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 @@ 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 @@ I have =$foo?> foo. - + See also: print, @@ -582,7 +582,7 @@ array explode string separator string string - int + int limit @@ -1017,7 +1017,7 @@ levenshtein - Calculate Levenshtein distance between two strings + Calculate Levenshtein distance between two strings @@ -1059,7 +1059,7 @@ 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 @@ - 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 @@ 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
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jeroen Sat Aug 25 20:55:53 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Fixed the other half of bug#12957 Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.106 phpdoc/en/functions/strings.xml:1.107 --- phpdoc/en/functions/strings.xml:1.106 Sat Aug 25 19:01:28 2001 +++ phpdoc/en/functions/strings.xml Sat Aug 25 20:55:53 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -1401,13 +1401,13 @@ -"\n" (ASCII 13 +"\n" (ASCII 10 (0x0A)), a new line (line feed). -"\r" (ASCII 10 +"\r" (ASCII 13 (0x0D)), a carriage return. @@ -1782,13 +1782,13 @@ -"\n" (ASCII 13 +"\n" (ASCII 10 (0x0A)), a new line (line feed). -"\r" (ASCII 10 +"\r" (ASCII 13 (0x0D)), a carriage return. @@ -3657,13 +3657,13 @@ -"\n" (ASCII 13 +"\n" (ASCII 10 (0x0A)), a new line (line feed). -"\r" (ASCII 10 +"\r" (ASCII 13 (0x0D)), a carriage return. @@ -3918,5 +3918,5 @@ sgml-local-catalogs:nil sgml-local-ecat-files:nil End: -vim: ts=1 sw=1 et syntax=sgml +vi: et:ts=1:sw=1:textwidth=78:syntax=sgml -->
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
eschmid Sat Aug 25 19:01:29 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Only whitespace changes. Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.105 phpdoc/en/functions/strings.xml:1.106 --- phpdoc/en/functions/strings.xml:1.105 Sat Aug 25 17:08:41 2001 +++ phpdoc/en/functions/strings.xml Sat Aug 25 19:01:28 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -10,7 +10,6 @@ specialized sections can be found in the regular expression and URL handling sections. - For information on how strings behave, especially with regard to usage of single quotes, double quotes, and escape sequences, see @@ -58,23 +57,23 @@ $escaped = addcslashes($not_escaped, "\0..\37!@\177..\377"); - - -When you define a sequence of characters in the charlist argument -make sure that you know what characters come between the characters -that you set as the start and end of the range. + + + When you define a sequence of characters in the charlist argument + make sure that you know what characters come between the + characters that you set as the start and end of the range. echo addcslashes('foo[]', 'A..z'); // All upper and lower-case letters will be escaped -// ..but so will the [\]^_` and space characters. +// ... but so will the [\]^_` and space characters. - -Also, if the first character in a range has a lower ASCII value -than the second character in the range, no range will be constructed. -Only the start, end and period characters will be escaped. Use the -ord function to find the ASCII value for a character. + Also, if the first character in a range has a lower ASCII value + than the second character in the range, no range will be + constructed. Only the start, end and period characters will be + escaped. Use the ord function to find the + ASCII value for a character. echo addcslashes("zoo['.']", 'z..A'); @@ -84,7 +83,6 @@ */ - Added in PHP 4 @@ -393,13 +391,13 @@ -Generates the cyclic redundancy checksum polynomial of 32-bit lengths of -the str. This is usually used to validate the -integrity of data being transmitted. - - - See also: md5 - + Generates the cyclic redundancy checksum polynomial of 32-bit + lengths of the str. This is usually used + to validate the integrity of data being transmitted. + + + See also: md5 + @@ -488,7 +486,7 @@ uses a one-way algorithm. - See also: md5. + See also: md5. @@ -591,21 +589,24 @@ Returns an array of strings, each of which is a substring of - string formed by splitting it on boundaries formed - by the string separator. - If limit is set, the returned array will contain - a maximum of limit elements with the last element - containing the whole rest of string. - If an empty string ("") is used as the separator - argument, then explode will return &false;. - If separator contains a value that is not contained in - the string argument, thenexplode - will return the string argument. + string formed by splitting it on + boundaries formed by the string separator. + If limit is set, the returned array will + contain a maximum of limit elements with + the last element containing the whole rest of + string. If an empty string ("") is used + as the separator argument, then + explode will return &false;. If + separator contains a value that is not + contained in the string argument, + thenexplode will return the + string argument. - The limit parameter was added in PHP 4.0.1 - + The limit parameter was added in PHP + 4.0.1 + @@ -629,7 +630,7 @@ See also preg_split, spliti, - split and + split, and implode. @@ -652,7 +653,9 @@ get_html_translation_table int table - int quote_style + int + quote_style + @@ -663,10 +666,11 @@ (HTML_ENTITIES, HTML_SPECIALCHARS) that allow you to specify the table you want. And as in the -htmlspecialchars and -htmlentities functions you can optionally specify the -quote_style you are working with. The default is ENT_COMPAT mode. See -the description of these modes in htmlspecialchars. + htmlspecialchars and + htmlentities functions you can optionally + specify the quote_style you are working with. The default is + ENT_COMPAT mode. See the description of these modes in + htmlspecialchars.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
eschmid Sat Aug 25 17:08:41 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Fix for #12957 reported by [EMAIL PROTECTED] and some whitespace. Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.104 phpdoc/en/functions/strings.xml:1.105 --- phpdoc/en/functions/strings.xml:1.104 Sun Aug 12 19:23:07 2001 +++ phpdoc/en/functions/strings.xml Sat Aug 25 17:08:41 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -1357,13 +1357,13 @@ "\n" (ASCII 13 -(0x0D)), a newline. +(0x0A)), a new line.(new line NL) "\r" (ASCII 10 -(0x0A)), a return. +(0x0D)), a carriage return. @@ -1375,7 +1375,7 @@ "\x0B" (ASCII 11 -(0x0B)), a . +(0x0B)), a vertical tab. @@ -1733,13 +1733,13 @@ "\n" (ASCII 13 -(0x0D)), a newline. +(0x0A)), a new line (line feed). "\r" (ASCII 10 -(0x0A)), a return. +(0x0D)), a carriage return. @@ -1751,7 +1751,7 @@ "\x0B" (ASCII 11 -(0x0B)), a . +(0x0B)), a vertical tab. @@ -1812,36 +1812,38 @@ -The function sscanf is the input analog of -printf. sscanf reads from -the string str and interprets it according to -the specified format. If only two parameters were -passed to this function, the values parsed will be returned as an array. - -sscanf Example - + The function sscanf is the input analog of + printf. sscanf reads + from the string str and interprets it + according to the specified format. If only + two parameters were passed to this function, the values parsed + will be returned as an array. + + sscanf Example + // getting the serial number $serial = sscanf("SN/2350001","SN/%d"); // and the date of manufacturing $mandate = "January 01 2000"; list($month, $day, $year) = sscanf($mandate,"%s %d %d"); echo "Item $serial was manufactured on: $year-".substr($month,0,3)."-$day\n"; - - -If optional parameters are passed, the function will return the number of -assigned values. The optional parameters must be passed by reference. - -sscanf - using optional parameters - + + + If optional parameters are passed, the function will return the + number of assigned values. The optional parameters must be passed + by reference. + + sscanf - using optional parameters + // get author info and generate DocBook entry $auth = "24\tLewis Carroll"; $n = sscanf($auth,"%d\t%s %s", &$id, &$first, &$last); echo "- \n"; - - + + See also: fscanf, printf, @@ -3590,13 +3592,13 @@ "\n" (ASCII 13 -(0x0D)), a newline. +(0x0A)), a new line (line feed). "\r" (ASCII 10 -(0x0A)), a return. +(0x0D)), a carriage return. @@ -3608,7 +3610,7 @@ "\x0B" (ASCII 11 -(0x0B)), a . +(0x0B)), a vertical tab.$first -$last +$first +$last
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jeroen Thu Aug 9 16:52:57 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Documented new second parameter of trim, ltrim and rtrim (and chop of course) Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.102 phpdoc/en/functions/strings.xml:1.103 --- phpdoc/en/functions/strings.xml:1.102 Sun Aug 5 18:49:38 2001 +++ phpdoc/en/functions/strings.xml Thu Aug 9 16:52:55 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -153,37 +153,20 @@ chop -Remove trailing whitespace +Alias of rtrim Description - - - string chop - string str - - - Returns the argument string without trailing whitespace, - including newlines. - - chop example - -$trimmed = chop($line); - - + This function is an alias of rtrim. chop is different than the Perl - chop() function, which removes the last + chop() function, which removes the last character in the string. - - See also trim, ltrim, - rtrim, and chop. - @@ -1323,6 +1306,7 @@ + ltrim @@ -1334,19 +1318,96 @@ Description - string ltrim - string str + string + ltrim + + string + str + + string + charlist + This function returns a string with whitespace stripped from the - beginning of str. The whitespace - characters it currently strips are: "\n", "\r", "\t", "\v", "\0", - and a plain space. + beginning of str. + Without the second parameter, + ltrim will strip these characters: + + + + +" " (ASCII 32 +(0x20)), an ordinary space. + + + + +"\t" (ASCII 9 +(0x09)), a tab. + + + + +"\n" (ASCII 13 +(0x0D)), a newline. + + + + +"\r" (ASCII 10 +(0x0A)), a return. + + + + +"\0" (ASCII 0 +(0x00)), the NUL-byte. + + + + +"\x0B" (ASCII 11 +(0x0B)), a . + + + + + + You can also specify the characters you want to strip, by means + of the charlist parameter. + Simply list all characters that you want to be stripped. With + .. you can specify a range of characters. + + Usuage example of ltrim + + + + + + + + + The second parameter was added in PHP 4.0.7 + + - See also chop, rtrim, and - trim. + See also trim and rtrim. @@ -1617,32 +1678,108 @@ + rtrim -Remove trailing whitespace. + + Strip whitespace from the end of a string + Description - string rtrim - string str + string + rtrim + + string + str + + string + charlist + - Returns the argument string without trailing whitespace, - including newlines. This is an alias for chop. - - rtrim example + This function returns a string with whitespace stripped from the + end of str. + Without the second parameter, + rtrim will strip these characters: + + + + +" " (ASCII 32 +(0x20)), an ordinary space. + + + + +"\t" (ASCII 9 +(0x09)), a tab. + + + + +"\n" (ASCII 13 +(0x0D)), a newline. + + + + +"\r" (ASCII 10 +(0x0A)), a return. + + + + +"\0" (ASCII 0 +(0x00)), the NUL-byte. + + + + +"\x0B" (ASCII 11 +(0x0B)), a . + + + + + + You can also specify the characters you want to strip, by means + of the charlist parameter. + Simply list all characters that you want to be stripped. With + .. you can specify a range of characters. + + + Usuage example of rtrim + -$trimmed = rtrim($line); + - - + + + + + The second parameter was added in PHP 4.0.7 + + - See also trim, ltrim, and - rtrim. + See also trim and ltrim. @@ -3398,6 +3535,7 @@ + trim @@ -3409,19 +3547,96 @@ Description - string trim - string str + string + trim + + string + str + + string + charlist + - This function returns a string with whitespace stripped from - the beginning and end of str. The - whitespace characters it currently stri
Re: [PHP-DOC] Re: Space between funcname & arglist (was: Re: [PHP-DOC] cvs: phpdoc /en/functions strings.xml)
Egon: > I would see a space. The formatted function prototypes have already a > space between function name and opening parenthesis. With the space the > code is more readable. The first can be changed, though I can come into your second point: better readable. In the case of a prototype, I must agree that it is better readable with a space. However, in code I prefer the PEAR-way. Since I prototype is such a different thing than a real-life function call, I think it doesn't matter too much that it isn't the 'right' way. Different point, in prototypes I sometimes see the proto: function(void). Why not simply function(). That looks way more logical to me, also keeping in mind that void is really a keyword that has no meaning in PHP, and PHP-programmers won't (need to) know it (unless they know it from some other language) Greetz, Jeroen
Re: [PHP-DOC] Re: Space between funcname & arglist (was: Re:[PHP-DOC] cvs: phpdoc /en/functions strings.xml)
Damien Seguy writes: > on 8/08/01 18:32, Hojtsy Gabor at [EMAIL PROTECTED] wrote: > > >>> Right now, here is the situation : > >>> no space : +2 > >>> space: 0 > Latest update : > > Right now, here is the situation : > no space : +3 > space: +1 > > > Anyone else want to state about this? > let's keep the polls open, this is vacation time. > > Damien Seguy No space +1. -- Torben Wilson <[EMAIL PROTECTED]> http://www.thebuttlesschaps.com +1.604.709.0506
Re: [PHP-DOC] Re: Space between funcname & arglist (was: Re:[PHP-DOC] cvs: phpdoc /en/functions strings.xml)
on 8/08/01 18:32, Hojtsy Gabor at [EMAIL PROTECTED] wrote: >>> Right now, here is the situation : >>> no space : +2 >>> space: 0 Latest update : Right now, here is the situation : no space : +3 space: +1 Anyone else want to state about this? let's keep the polls open, this is vacation time. Damien Seguy
Re: [PHP-DOC] Re: Space between funcname & arglist (was: Re: [PHP-DOC] cvs: phpdoc /en/functions strings.xml)
> > Right now, here is the situation : > > no space : +2 > > space: 0 > > I would see a space. The formatted function prototypes have already a > space between function name and opening parenthesis. With the space the > code is more readable. > > -1 (space) We should write codes according to the PEAR coding standard. This is not just the question of a space or no space, it is the question of a common coding standard. There is one now, named the PEAR coding standard, so why not use this? Goba
Re: [PHP-DOC] Re: Space between funcname & arglist (was: Re: [PHP-DOC] cvs: phpdoc /en/functions strings.xml)
On Wed, Aug 08, 2001 at 09:51:50AM +0200, Damien Seguy wrote: > on 8/08/01 0:06, Jeroen van Wolffelaar at [EMAIL PROTECTED] wrote: > > > From PEAR coding standards (function calls): > I got those one from README file in phpdoc/README. > > I do agree with the no space between function name and opening parenthesis. > At least, we should be coherent with the rest of the PHP team on this. > > Before we change this convention, does anyone have opinion about this? > I wonder what was the reason about this (I guess it's one of those fashion > that cross informatics coding world). > > Right now, here is the situation : > no space : +2 > space: 0 I would see a space. The formatted function prototypes have already a space between function name and opening parenthesis. With the space the code is more readable. -1 (space) -Egon -- All known books about PHP and related books: http://php.net/books.php Concert Band of the University of Hohenheim: http://www.concert-band.de/ First and second bestselling book in German: http://www.php-buch.de/
Re: [PHP-DOC] Re: Space between funcname & arglist (was: Re:[PHP-DOC] cvs: phpdoc /en/functions strings.xml)
on 8/08/01 0:06, Jeroen van Wolffelaar at [EMAIL PROTECTED] wrote: > From PEAR coding standards (function calls): I got those one from README file in phpdoc/README. I do agree with the no space between function name and opening parenthesis. At least, we should be coherent with the rest of the PHP team on this. Before we change this convention, does anyone have opinion about this? I wonder what was the reason about this (I guess it's one of those fashion that cross informatics coding world). Right now, here is the situation : no space : +2 space: 0 Best regards, Damien Seguy
[PHP-DOC] Re: Space between funcname & arglist (was: Re: [PHP-DOC] cvs: phpdoc /en/functions strings.xml)
> MMM, I thought that whitespace between funcname and open parenthesis was > standard guideline for docs. > > README : > 8. If an example of using arguments specific to a newer version of >php, it is helpful to note that in the example: > >foo_function_exec ("bar", "baz"); // second argument was added in PHP > 4.0.3 >From PEAR coding standards (function calls): Functions should be called with no spaces between the function name, the opening parenthesis, and the first parameter (etc) I assumed that was the standard for the documentation too... am I wrong? Jeroen
Re: [PHP-DOC] cvs: phpdoc /en/functions strings.xml
on 6/08/01 0:49, Jeroen van Wolffelaar at [EMAIL PROTECTED] wrote: > jeroenSun Aug 5 18:49:38 2001 EDT > > Modified files: > /phpdoc/en/functionsstrings.xml > Log: > Fix examles (whitespace between funcname and parameters), and a few entities MMM, I thought that whitespace between funcname and open parenthesis was standard guideline for docs. README : 8. If an example of using arguments specific to a newer version of php, it is helpful to note that in the example: foo_function_exec ("bar", "baz"); // second argument was added in PHP 4.0.3 I don't use it on French docs thought, but I make it consistent on the whole fr tree. I do respect this on English tree. Moreover, why don't you do some testing on nl tree before making such important changes on the whole en tree? I think that experimenting somewhat is really good for all of us. Best regards, Damien Seguy
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jeroen Sun Aug 5 18:49:38 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Fix examles (whitespace between funcname and parameters), and a few entities Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.101 phpdoc/en/functions/strings.xml:1.102 --- phpdoc/en/functions/strings.xml:1.101 Sun Aug 5 06:51:46 2001 +++ phpdoc/en/functions/strings.xml Sun Aug 5 18:49:38 2001 @@ -1,5 +1,5 @@ - + String functions Strings @@ -22,7 +22,7 @@ -AddCSlashes +addcslashes Quote string with slashes in a C style @@ -55,7 +55,7 @@ addcslashes example -$escaped = addcslashes ($not_escaped, "\0..\37!@\177..\377"); +$escaped = addcslashes($not_escaped, "\0..\37!@\177..\377"); @@ -101,7 +101,7 @@ -AddSlashes +addslashes Quote string with slashes @@ -169,7 +169,7 @@ chop example -$trimmed = chop ($line); +$trimmed = chop($line); @@ -206,11 +206,11 @@ chr example -$str .= chr (27); /* add an escape character at the end of $str */ +$str .= chr(27); /* add an escape character at the end of $str */ /* Often this is more useful */ -$str = sprintf ("The string ends in escape: %c", 27); +$str = sprintf("The string ends in escape: %c", 27); This function complements ord. See also @@ -252,7 +252,7 @@ # format $data using RFC 2045 semantics -$new_string = chunk_split (base64_encode($data)); +$new_string = chunk_split(base64_encode($data)); This function is significantly faster than @@ -560,7 +560,7 @@ // However, the following examples will work: ($some_var) ? print('true'): print('false'); // print is a function -echo ($some_var) ? 'true': 'false'; // changing the statement around +echo $some_var ? 'true': 'false'; // changing the statement around ?> @@ -623,7 +623,7 @@ explode example $pizza = "piece1 piece2 piece3 piece4 piece5 piece6"; -$pieces = explode (" ", $pizza); +$pieces = explode(" ", $pizza); @@ -681,9 +681,9 @@ Translation Table Example -$trans = get_html_translation_table (HTML_ENTITIES); +$trans = get_html_translation_table(HTML_ENTITIES); $str = "Hallo && Krämer"; -$encoded = strtr ($str, $trans); +$encoded = strtr($str, $trans); The $encoded variable will now contain: "Hallo @@ -696,8 +696,8 @@ the direction of the translation. -$trans = array_flip ($trans); -$original = strtr ($str, $trans); +$trans = array_flip($trans); +$original = strtr($str, $trans); The content of $original would be: "Hallo & @@ -970,7 +970,7 @@ implode example -$colon_separated = implode (":", $array); +$colon_separated = implode(":", $array); @@ -1465,7 +1465,7 @@ ord example -if (ord ($str) == 10) { +if (ord($str) == 10) { echo "The first character of \$str is a line feed.\n"; } @@ -1636,7 +1636,7 @@ rtrim example -$trimmed = rtrim ($line); +$trimmed = rtrim($line); @@ -1841,12 +1841,12 @@ Soundex Examples -soundex ("Euler") == soundex ("Ellery") == 'E460'; -soundex ("Gauss") == soundex ("Ghosh") == 'G200'; -soundex ("Hilbert") == soundex ("Heilbronn") == 'H416'; -soundex ("Knuth") == soundex ("Kant") == 'K530'; -soundex ("Lloyd") == soundex ("Ladd") == 'L300'; -soundex ("Lukasiewicz") == soundex ("Lissajous") == 'L222'; +soundex("Euler") == soundex("Ellery") == 'E460'; +soundex("Gauss") == soundex("Ghosh") == 'G200'; +soundex("Hilbert") == soundex("Heilbronn") == 'H416'; +soundex("Knuth") == soundex("Kant") == 'K530'; +soundex("Lloyd") == soundex("Ladd") == 'L300'; +soundex("Lukasiewicz") == soundex("Lissajous") == 'L222'; @@ -2027,7 +2027,7 @@ sprintf: zero-padded integers -$isodate = sprintf ("%04d-%02d-%02d", $year, $month, $day); +$isodate = sprintf("%04d-%02d-%02d", $year, $month, $day); @@ -2037,7 +2037,7 @@ $money2 = 54.35; $money = $money1 + $money2; // echo $money will output "123.1"; -$formatted = sprintf ("%01.2f", $money); +$formatted = sprintf("%01.2f", $money); // echo $formatted will output "123.10" @@ -2110,7 +2110,7 @@ $var1 = "Hello"; $var2 = "hello"; -if (!strcasecmp ($var1, $var2)) { +if (!strcasecmp($var1, $var2)) { echo '$var1 is equal to $var2 in a case-insensitive string comparison'; } @@ -2421,7 +2421,7 @@ below: -$arr1 = $arr2 = array ("img12.png","img10.png","img2.png","img1.png"); +$arr1 = $arr2 = array("img12.png","img10.png","img2.png","img1.png"); echo "Standard string comparison\n"; usort($arr1,"strcmp"); print_r($arr1); @@ -2655,14 +2655
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
martin Mon Jul 16 05:19:52 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Fix PR#12156 Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.98 phpdoc/en/functions/strings.xml:1.99 --- phpdoc/en/functions/strings.xml:1.98Sat Jul 7 17:27:16 2001 +++ phpdoc/en/functions/strings.xml Mon Jul 16 05:19:52 2001 @@ -1128,7 +1128,7 @@ take into account the relevance of and/or difference between certain symbols (characters) or even the context those symbols appear in to determine the cost of insert, replace and delete - operations, but at the cost of loosing all optimizations done + operations, but at the cost of losing all optimizations done regarding cpu register utilization and cache misses that have been worked into the other two variants.
Re: [PHP-DOC] cvs: phpdoc /en/functions strings.xml
On Thu, 28 Jun 2001, Jeroen van Wolffelaar wrote: > > Please don't use tabs, but only spaces for indentation. > > I'm sorry, I didn't know vim used tabs automatically... > :set et sw=1 ts=1 > seems to fix that. > > Anyone knows of an option to visualise the tabs? Not :set list, since it > renders the ts useless. /\t will search for tabs, and if you set this option in your .vimrc all occurences will be displayed too: :set hlsearch :highlight Search ctermfg=1 ctermbg=7 It may be possible to set these options too( but before the other 2 above): :if has("terminfo") : set t_Co=8 : set t_Sf=^[[3%p1%dm : set t_Sb=^[[4%p1%dm :else : set t_Co=8 : set t_Sf=^[[3%dm : set t_Sb=^[[4%dm :endif regards, Derick
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jeroen Thu Jun 28 19:03:47 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Fixed tabs to spaces.
Re: [PHP-DOC] cvs: phpdoc /en/functions strings.xml
> Please don't use tabs, but only spaces for indentation. I'm sorry, I didn't know vim used tabs automatically... :set et sw=1 ts=1 seems to fix that. Anyone knows of an option to visualise the tabs? Not :set list, since it renders the ts useless. It'll be reverted on my next commit. Jeroen
Re: [PHP-DOC] cvs: phpdoc /en/functions strings.xml
On Wed, 27 Jun 2001, Jeroen van Wolffelaar wrote: > Implemented zak's notes on addcslashes > > + > + > + Be careful if you choose to escape characters 0, a, b, f, n, r, Please don't use tabs, but only spaces for indentation. Derick
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jeroen Wed Jun 27 11:58:49 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Implemented zak's notes on addcslashes Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.94 phpdoc/en/functions/strings.xml:1.95 --- phpdoc/en/functions/strings.xml:1.94Sat Jun 23 22:10:51 2001 +++ phpdoc/en/functions/strings.xml Wed Jun 27 11:58:49 2001 @@ -38,8 +38,17 @@ listed in charlist parameter. It escapes \n, \r etc. in C-like style, characters with ASCII code lower than 32 and higher than - 126 are converted to octal representation. Be carefull when - escaping alphanumeric characters. You can specify a range in + 126 are converted to octal representation. + + + Be careful if you choose to escape characters 0, a, b, f, n, r, +t and v. They will be converted to \0, \a, \b, \f, \n, \r, \t +and \v. + In PHP \0 (NULL), \r (carriage return), \n (newline) and \t (tab) +are predefined escape sequences, while in C all of these are +predefined escape sequences. + + charlist like "\0..\37", which would escape all characters with ASCII code between 0 and 31. @@ -48,9 +57,36 @@ $escaped = addcslashes ($not_escaped, "\0..\37!@\177..\377"); + + +When you define a sequence of characters in the charlist argument +make sure that you know what characters come between the characters +that you set as the start and end of the range. + + +echo addcslashes('foo[]', 'A..z'); +// All upper and lower-case letters will be escaped +// ..but so will the [\]^_` and space characters. + + + +Also, if the first character in a range has a lower ASCII value +than the second character in the range, no range will be constructed. +Only the start, end and period characters will be escaped. Use the +ord function to find the ASCII value for a character. + + +echo addcslashes("zoo['.']", 'z..A'); +/* output: +\zoo['\.'] + +*/ + + + - Added in PHP4b3-dev. + Added in PHP 4
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
damsWed May 23 05:01:53 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Added to rtrim Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.90 phpdoc/en/functions/strings.xml:1.91 --- phpdoc/en/functions/strings.xml:1.90Tue May 22 15:52:58 2001 +++ phpdoc/en/functions/strings.xml Wed May 23 05:01:52 2001 @@ -1585,8 +1585,10 @@ Description - string rtrim - string str + + string rtrim + string str + Returns the argument string without trailing whitespace,
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
sniper Tue May 22 15:52:59 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: fixed typo Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.89 phpdoc/en/functions/strings.xml:1.90 --- phpdoc/en/functions/strings.xml:1.89Tue May 22 09:11:30 2001 +++ phpdoc/en/functions/strings.xml Tue May 22 15:52:58 2001 @@ -1392,7 +1392,7 @@ Starting with PHP 4.0.5, nl2br is now XHTML - complaint. All versions before 4.0.5 will return + compliant. All versions before 4.0.5 will return string with '
' inserted before newlines instead of '
'.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
danbeck Tue May 22 09:11:31 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: clarified XHTML compatibility change to nl2br Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.88 phpdoc/en/functions/strings.xml:1.89 --- phpdoc/en/functions/strings.xml:1.88Mon May 21 10:56:06 2001 +++ phpdoc/en/functions/strings.xml Tue May 22 09:11:30 2001 @@ -1389,11 +1389,14 @@ Returns string with '
' inserted before all newlines. + - Until PHP 4.0.5, nl2br will return - string with '
' inserted - before all newlines. + Starting with PHP 4.0.5, nl2br is now XHTML + complaint. All versions before 4.0.5 will return + string with '
' inserted before + newlines instead of '
'. + See also htmlspecialchars, htmlentities and
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
damsMon May 21 10:56:07 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Adding zak's note Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.87 phpdoc/en/functions/strings.xml:1.88 --- phpdoc/en/functions/strings.xml:1.87Sat May 19 17:50:14 2001 +++ phpdoc/en/functions/strings.xml Mon May 21 10:56:06 2001 @@ -570,6 +570,11 @@ If limit is set, the returned array will contain a maximum of limit elements with the last element containing the whole rest of string. + If an empty string ("") is used as the separator + argument, then explode will return FALSE. + If separator contains a value that is not contained in + the string argument, thenexplode + will return the string argument.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
hholzgraWed May 2 07:11:06 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: reverting yesterdays accitential commit Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.85 phpdoc/en/functions/strings.xml:1.86 --- phpdoc/en/functions/strings.xml:1.85Tue May 1 09:20:51 2001 +++ phpdoc/en/functions/strings.xml Wed May 2 07:11:06 2001 @@ -3426,27 +3426,15 @@ -<<< strings.xml -<<< strings.xml - Capitalizes the first character of each word in -str if that character is alphabetic. A -word is defined as any sequence of non-whitespace letters (of the -current locale) immediately following a whitespace (space, -horizontal or vertical tab, linefeed or carriage return). -=== - Retuns a string with the first character of each word in -=== Returns a string with the first character of each word in ->>> 1.83 str capitalized, if that character is alphabetic. ->>> 1.77 ucwords example -$text = "mary had a little lamb and she loved it so."; $text = -ucwords($text); // $text is now: Mary Had A Little // Lamb And -She Loved It So. +$text = "mary had a little lamb and she loved it so."; +$text = ucwords($text); // $text is now: Mary Had A Little +// Lamb And She Loved It So.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
damsTue Apr 24 00:27:02 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Added new behaviour of nl2br() Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.83 phpdoc/en/functions/strings.xml:1.84 --- phpdoc/en/functions/strings.xml:1.83Sun Apr 15 10:23:21 2001 +++ phpdoc/en/functions/strings.xml Tue Apr 24 00:27:01 2001 @@ -1385,6 +1385,11 @@ before all newlines. + Until PHP 4.0.5, nl2br will return + string with '
' inserted + before all newlines. + + See also htmlspecialchars, htmlentities and wordwrap.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
avsmSun Apr 15 10:23:21 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Fix typos Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.82 phpdoc/en/functions/strings.xml:1.83 --- phpdoc/en/functions/strings.xml:1.82Sun Apr 15 10:16:47 2001 +++ phpdoc/en/functions/strings.xml Sun Apr 15 10:23:21 2001 @@ -292,7 +292,7 @@ count_chars - Return information abouts characters used in a string + Return information about characters used in a string @@ -309,7 +309,7 @@ - Counts the number of occurances of every byte-value (0..255) in + Counts the number of occurrences of every byte-value (0..255) in string and returns it in various ways. The optional parameter Mode default to 0. Depending on mode @@ -317,7 +317,7 @@ - 0 - an array with the byte-value as key and the freqency of + 0 - an array with the byte-value as key and the frequency of every byte as value. @@ -369,7 +369,7 @@ Generates the cyclic redundancy checksum polynomial of 32-bit lengths of the str. This is usually used to validate the -integrity of data being trasmited. +integrity of data being transmitted. See also: md5 @@ -488,7 +488,7 @@ Echo is not actually a function (it is a - language construct) so you are not required to use parantheses + language construct) so you are not required to use parentheses with it. In fact, if you want to pass more than one parameter to echo, you must not enclose the parameters within parentheses. @@ -567,7 +567,7 @@ Returns an array of strings, each of which is a substring of string formed by splitting it on boundaries formed by the string delim. - If limit is set, the returned array will contaion + If limit is set, the returned array will contain a maximum of limit elements with the last element containing the whole rest of string. @@ -1018,7 +1018,7 @@ but still expensive). -In its simpelest form the function will take only the two +In its simplest form the function will take only the two strings as parameter and will calculate just the number of insert, replace and delete operations needed to transform str1 into str2. @@ -1152,7 +1152,7 @@ mon_thousands_sep -Monetary thousands seperator +Monetary thousands separator mon_grouping @@ -1180,7 +1180,7 @@ p_sep_by_space -True if a space seperates currency_symbol from a positive value, false otherwise +True if a space separates currency_symbol from a positive value, false +otherwise n_cs_precedes @@ -1188,7 +1188,7 @@ n_sep_by_space -True if a space seperates currency_symbol from a negative value, false otherwise +True if a space separates currency_symbol from a negative value, false +otherwise p_sign_posn @@ -1711,7 +1711,7 @@ Setlocale returns the new current locale, or false if the locale - functionality is not implemented in the plattform, the specified + functionality is not implemented in the platform, the specified locale does not exist or the category name is invalid. An invalid category name also causes a warning message. @@ -2393,7 +2393,7 @@ ) -For more infomation see: Martin Pool's Natural Order String Comparison page. @@ -2437,7 +2437,7 @@ This function implements a comparison algorithm that orders alphanumeric strings in the way a human being would. The -behavior of this function is similar to +behaviour of this function is similar to strnatcmp, except that the comparison is not case sensitive. For more infomation see: Martin Pool's Natural Order String @@ -2524,7 +2524,7 @@ This functions returns the input string - padded on the left, the right, or both sides to the specifed + padded on the left, the right, or both sides to the specified padding length. If the optional argument pad_string is not supplied, the input is padded with spaces, otherwise it @@ -3421,7 +3421,7 @@ - Retuns a string with the first character of each word in + Returns a string with the first character of each word in str capitalized, if that character is alphabetic. @@ -3488,7 +3488,7 @@ 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 g
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
avsmSun Apr 15 10:16:48 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: add 'strchr' to the See Also list - strrchr was there, but not strchr Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.81 phpdoc/en/functions/strings.xml:1.82 --- phpdoc/en/functions/strings.xml:1.81Mon Apr 9 09:00:17 2001 +++ phpdoc/en/functions/strings.xml Sun Apr 15 10:16:47 2001 @@ -2674,7 +2674,7 @@ - See also substr, + See also strchr, substr, stristr, and strstr. @@ -2877,7 +2877,7 @@ - See also stristr, + See also strchr, stristr, strrchr, substr, and ereg.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
rasmus Mon Apr 9 09:00:18 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Document argument swapping in [s]printf format string Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.80 phpdoc/en/functions/strings.xml:1.81 --- phpdoc/en/functions/strings.xml:1.80Sun Mar 25 19:44:44 2001 +++ phpdoc/en/functions/strings.xml Mon Apr 9 09:00:17 2001 @@ -1915,6 +1915,48 @@ + + As of PHP version 4.0.6 the format string supports argument +numbering/swapping. Here is an example: + +Argument swapping + +$format = "There are %d monkeys in the %s"; +printf($format,$num,$location); + + + This might output, "There are 5 monkeys in the tree". But imagine we are + creating a format string in a separate file, commonly because we would like to + internationalize it and we rewrite it as: + +Argument swapping + +$format = "The %s contains %d monkeys"; +printf($format,$num,$location); + + + We now have a problem. The order of the placeholders in the format string + does not match the order of the arguments in the code. We would like to + leave the code as is and simply indicate in the format string which arguments + the placeholders refer to. We would write the format string like this + instead: + +Argument swapping + +$format = "The %2\$s contains %1\$d monkeys"; +printf($format,$num,$location); + + + An added benefit here is that you can repeat the placeholders without + adding more arguments in the code. For example: + +Argument swapping + +$format = "The %2\$s contains %1\$d monkeys. That's a nice %2\$s full of %1\$d +monkeys."; +printf($format,$num,$location); + + + See also: printf, sscanf, fscanf, and number_format.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
jmcastagnetto Sun Mar 25 19:44:44 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Added some more text to explain the strspn example Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.79 phpdoc/en/functions/strings.xml:1.80 --- phpdoc/en/functions/strings.xml:1.79Tue Mar 20 21:59:43 2001 +++ phpdoc/en/functions/strings.xml Sun Mar 25 19:44:44 2001 @@ -2775,15 +2775,15 @@ str1 which consists entirely of characters in str2. - + + The line of code: -strspn ("42 is the answer, what is the question ...", "1234567890"); +$var = strspn ("42 is the answer, what is the question ...", "1234567890"); - - will return 2 as result. - + will assign 2 to $var, because the string "42" will + be the longest segment containing characters from "1234567890". See also strcspn.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
ronabop Tue Mar 20 21:59:44 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Adding more echo examples per errata. Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.78 phpdoc/en/functions/strings.xml:1.79 --- phpdoc/en/functions/strings.xml:1.78Sat Mar 10 10:51:47 2001 +++ phpdoc/en/functions/strings.xml Tue Mar 20 21:59:43 2001 @@ -489,10 +489,12 @@ Echo is not actually a function (it is a language construct) so you are not required to use parantheses - with it. + with it. In fact, if you want to pass more than one parameter + to echo, you must not enclose the parameters within parentheses. - Echo example + Echo examples + + + + Echo also has a shortcut syntax, where you + can immediately follow the opening tag with an equals sign. + + +I have =$foo?> foo. + + - - - In fact, if you want to pass more than one parameter to echo, - you must not enclose the parameters within parentheses. - - See also: print,
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
sniper Sat Mar 10 10:51:47 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Setlocale uses constants now. +ws fix Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.77 phpdoc/en/functions/strings.xml:1.78 --- phpdoc/en/functions/strings.xml:1.77Sat Feb 24 19:05:49 2001 +++ phpdoc/en/functions/strings.xml Sat Mar 10 10:51:47 2001 @@ -1630,44 +1630,43 @@ string setlocale - string category + mixed category string locale - Category is a string specifying the - category of the functions affected by the locale setting: + Category is a named constant (or string) + specifying the category of the functions affected by the locale setting: - LC_ALL for all of the below +LC_ALL for all of the below - LC_COLLATE for string comparison, see strcoll +LC_COLLATE for string comparison, see strcoll - LC_CTYPE for character classification and conversion, for - example strtoupper +LC_CTYPE for character classification and conversion, for +example strtoupper - LC_MONETARY for localeconv +LC_MONETARY for localeconv - LC_NUMERIC for decimal separator (See also: localeconv) +LC_NUMERIC for decimal separator (See also: localeconv) - LC_TIME for date and time formatting with - strftime +LC_TIME for date and time formatting with strftime
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
ronabop Sat Feb 24 19:05:49 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Typos. Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.76 phpdoc/en/functions/strings.xml:1.77 --- phpdoc/en/functions/strings.xml:1.76Sat Feb 24 18:38:53 2001 +++ phpdoc/en/functions/strings.xml Sat Feb 24 19:05:49 2001 @@ -247,9 +247,9 @@ - This function returns the given string from one Cyrillic - character set to another. The from and - to arguments are single characters that + This function returns the given string converted from one + Cyrillic character set to another. The from + and to arguments are single characters that represent the source and target Cyrillic character sets. The supported types are: @@ -2137,7 +2137,7 @@ This function tries to return a string with all HTML and PHP - tags stripped from a given str, + tags stripped from a given str. It errors on the side of caution in case of incomplete or bogus tags. It uses the same tag stripping state machine as the fgetss function. @@ -3312,7 +3312,7 @@ - Retuns a string with the first character of + Returns a string with the first character of str capitalized, if that character is alphabetic.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
ronabop Sat Feb 24 18:38:53 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Clarifying function returns. Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.75 phpdoc/en/functions/strings.xml:1.76 --- phpdoc/en/functions/strings.xml:1.75Fri Feb 23 07:35:46 2001 +++ phpdoc/en/functions/strings.xml Sat Feb 24 18:38:53 2001 @@ -247,7 +247,7 @@ - This function converts the given string from one Cyrillic + This function returns the given string from one Cyrillic character set to another. The from and to arguments are single characters that represent the source and target Cyrillic character sets. The @@ -394,7 +394,7 @@ - crypt will encrypt a string using the + crypt will return an encrypted string using the standard Unix DES encryption method. Arguments are a string to be encrypted and an optional two-character salt string to base the encryption on. See the Unix man page for your @@ -952,7 +952,7 @@ Description - int levenshtein + int levenshtein string str1 string str2 @@ -972,10 +972,10 @@ -This function returns the Levenshtein-Distance between the + This function returns the Levenshtein-Distance between the two argument strings or -1, if one of the argument strings is longer than the limit of 255 characters (255 should be -more than enough for name or dictionary comparison, and + more than enough for name or dictionary comparison, and nobody serious would be doing genetic analysis with PHP). @@ -1266,8 +1266,8 @@ - This function strips whitespace from the start of a string and - returns the stripped string. The whitespace + This function returns a string with whitespace stripped from the + beginning of str. The whitespace characters it currently strips are: "\n", "\r", "\t", "\v", "\0", and a plain space. @@ -1294,7 +1294,7 @@ Calculates the MD5 hash of str using the RSA Data Security, Inc. - MD5 Message-Digest Algorithm. + MD5 Message-Digest Algorithm, and returns that hash. See also: crc32 @@ -1476,8 +1476,8 @@ See also: print, sprintf, -sscanf, fscanf, -and flush. + sscanf, fscanf, + and flush. @@ -2136,8 +2136,9 @@ - This function tries to strip all HTML and PHP tags from the given - string. It errors on the side of caution in case of incomplete + This function tries to return a string with all HTML and PHP + tags stripped from a given str, + It errors on the side of caution in case of incomplete or bogus tags. It uses the same tag stripping state machine as the fgetss function. @@ -2453,9 +2454,9 @@ - This functions pads the input string on - the left, the right, or both sides to the specifed padding - length. If the optional argument + This functions returns the input string + padded on the left, the right, or both sides to the specifed + padding length. If the optional argument pad_string is not supplied, the input is padded with spaces, otherwise it is padded with characters from pad_string @@ -2944,7 +2945,7 @@ str_replace - Replace all occurrences of the search string in subject with the replacement string + Replace all occurrences of the search string with the replacement string @@ -2958,19 +2959,20 @@ - This function replaces all occurences of search in - subject with the given - replace value. If you don't need fancy replacing - rules, you should always use this function instead of - ereg_replace or - preg_replace. + This function returns a string or an array with all occurences of + search in subject + replaced with the given replace value. If + you don't need fancy replacing rules, you should always use this + function instead of ereg_replace or + preg_replace. + In PHP 4.0.5 and later, every parameter to str_replace can be an array. If subject is an array, then the search and replace - is performed on every entry of subject, and the + is performed with every entry of subject, and the return value is an array as well. @@ -3024,10 +3026,10 @@ - This function operates on str, translating - all occurrences of each character in from - to the corresponding character in to and - returning the result. + This function returns a copy of str, + translating all occurrences of each character in + from to the correspon
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
sas Fri Feb 23 07:35:46 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: reflect that nl2br has been changed to conform to xhtml 1.0. Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.74 phpdoc/en/functions/strings.xml:1.75 --- phpdoc/en/functions/strings.xml:1.74Thu Feb 22 16:05:34 2001 +++ phpdoc/en/functions/strings.xml Fri Feb 23 07:35:46 2001 @@ -1353,7 +1353,7 @@ - Returns string with '
' inserted + Returns string with '
' inserted before all newlines.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
torben Thu Feb 22 16:05:35 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Clarified nl2br() refpurpose. Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.73 phpdoc/en/functions/strings.xml:1.74 --- phpdoc/en/functions/strings.xml:1.73Thu Feb 8 02:27:59 2001 +++ phpdoc/en/functions/strings.xml Thu Feb 22 16:05:34 2001 @@ -1342,7 +1342,7 @@ nl2br -Converts newlines to HTML line breaks +Inserts HTML line breaks before all newlines in a string Description
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
damsThu Feb 1 08:23:41 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Removed double htmlspecialchars citation. Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.71 phpdoc/en/functions/strings.xml:1.72 --- phpdoc/en/functions/strings.xml:1.71Mon Jan 22 13:48:59 2001 +++ phpdoc/en/functions/strings.xml Thu Feb 1 08:23:41 2001 @@ -55,7 +55,6 @@ See also stripcslashes, stripslashes, - htmlspecialchars, htmlspecialchars, and quotemeta.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
andrei Mon Jan 22 13:48:59 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Docs for str_replace() improvements. Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.70 phpdoc/en/functions/strings.xml:1.71 --- phpdoc/en/functions/strings.xml:1.70Sat Jan 20 11:15:05 2001 +++ phpdoc/en/functions/strings.xml Mon Jan 22 13:48:59 2001 @@ -2944,28 +2944,49 @@ str_replace - Replace all occurrences of needle in haystack with str + Replace all occurrences of the search string in subject with the replacement +string Description - string str_replace - string needle - string str - string haystack + mixed str_replace + mixed search + mixed replace + mixed subject - This function replaces all occurences of - needle in haystack - with the given str. If you don't need - fancy replacing rules, you should always use this function - instead of ereg_replace. + This function replaces all occurences of search in + subject with the given + replace value. If you don't need fancy replacing + rules, you should always use this function instead of + ereg_replace or + preg_replace. + In PHP 4.0.5 and later, every parameter to + str_replace can be an array. + + + If subject is an array, then the search and replace + is performed on every entry of subject, and the + return value is an array as well. + + + If search and replace are + arrays, then str_replace takes a value from each + array and uses them to do search and replace on + subject. If replace has + fewer values than search, then an empty string is + used for the rest of replacement values. If search + is an array and replace is a string; then this + replacement string is used for every value of + search. The converse would not make sense, though. + + - Str_replace example + str_replace example $bodytag = str_replace ("%body%", "black", ""); @@ -2976,13 +2997,13 @@ - Str_replace was added in PHP 3.0.6, but was + str_replace was added in PHP 3.0.6, but was buggy up until PHP 3.0.8. - See also ereg_replace and - strtr. + See also ereg_replace, + preg_replace, and strtr.
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
elixer Sat Jan 20 11:15:05 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Update setlocale() to reflect the addition of strcoll() Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.69 phpdoc/en/functions/strings.xml:1.70 --- phpdoc/en/functions/strings.xml:1.69Sat Jan 20 11:12:53 2001 +++ phpdoc/en/functions/strings.xml Sat Jan 20 11:15:05 2001 @@ -1645,7 +1645,7 @@ - LC_COLLATE for string comparison - not currently implemented in PHP + LC_COLLATE for string comparison, see strcoll
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
elixer Sat Jan 20 11:12:53 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Added strcoll() documentation Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.68 phpdoc/en/functions/strings.xml:1.69 --- phpdoc/en/functions/strings.xml:1.68Tue Jan 16 15:26:07 2001 +++ phpdoc/en/functions/strings.xml Sat Jan 20 11:12:53 2001 @@ -2051,6 +2051,47 @@ + + +strcoll +Locale based string comparison + + +Description + + + int strcoll + string str1 + string str2 + + + + Returns < 0 if str1 is less than + str2; > 0 if str1 + is greater than str2, and 0 if they are + equal. strcoll uses the current locale for + doing the comparisons. If the current locale is C or POSIX, this + function is equivalent to strcmp. + + + Note that this comparison is case sensitive, and unlike + strcmp this function is not binary safe. + + + + Added in PHP 4.0.5. + + + + See also ereg, strcmp, + strcasecmp, substr, + stristr, strncasecmp, + strncmp, strstr, + and setlocale. + + + + strcspn
[PHP-DOC] cvs: phpdoc /en/functions strings.xml
elixer Tue Jan 16 15:26:07 2001 EDT Modified files: /phpdoc/en/functionsstrings.xml Log: Added localeconv() documentation Updated setlocale() documentation to reference localeconv() Index: phpdoc/en/functions/strings.xml diff -u phpdoc/en/functions/strings.xml:1.67 phpdoc/en/functions/strings.xml:1.68 --- phpdoc/en/functions/strings.xml:1.67Thu Dec 21 16:57:14 2000 +++ phpdoc/en/functions/strings.xml Tue Jan 16 15:26:07 2001 @@ -1068,6 +1068,188 @@ + + +localeconv +Get numeric formatting information + + +Description + + + array localeconv + + + + + Returns an associative array containing localized numeric and monetary + formatting information. + + + localeconv returns data based upon the current locale + as set by setlocale. The associative array that is + returned contains the following fields: + + + + + Array element + Description + + + + + decimal_point + Decimal point character + + + thousands_sep + Thousands separator + + +grouping +Array containing numeric groupings + + +int_curr_symbol +International currency symbol (i.e. USD) + + +currency_symbol +Local currency symbol (i.e. $) + + +mon_decimal_point +Monetary decimal point character + + +mon_thousands_sep +Monetary thousands seperator + + +mon_grouping +Array containing monetary groupings + + +positive_sign +Sign for positive values + + +negative_sign +Sign for negative values + + +int_frac_digits +International fractional digits + + +frac_digits +Local fractional digits + + +p_cs_precedes +True if currency_symbol precedes a positive value, false if it +succeeds one + + +p_sep_by_space +True if a space seperates 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_sep_by_space +True if a space seperates currency_symbol from a negative value, false +otherwise + + +p_sign_posn + + + 0 + Parentheses surround the quantity and currency_symbol + 1 + The sign string precedes the quantity and currency_symbol + 2 + The sign string succeeds the quantity and currency_symbol + 3 + The sign string immediately precedes the currency_symbol + 4 + The sign string immediately succeeds the currency_symbol + + + + +n_sign_posn + + + 0 + Parentheses surround the quantity and currency_symbol + 1 + The sign string precedes the quantity and currency_symbol + 2 + The sign string succeeds the quantity and currency_symbol + 3 + The sign string immediately precedes the currency_symbol + 4 + The sign string immediately succeeds the currency_symbol + + + + + + + + + The grouping fields contain arrays that define the way numbers should be grouped. + For example, the grouping field for the en_US locale, would contain a 2 item +array + with the values 3 and 3. The higher the index in the array, the farther left the + grouping is. If an array element is equal to CHAR_MAX, no further grouping is +done. + If an array element is equal to 0, the previous element should be used. + + + localeconv example + +setlocale(LC_ALL, "en_US"); + +$locale_info = localeconv(); + +echo "\n"; +echo "\n"; +echo " Monetary information for current locale: \n"; +echo "\n\n"; + +echo "int_curr_symbol: {$locale_info["int_curr_symbol"]}\n"; +echo "currency_symbol: {$locale_info["currency_symbol"]}\n"; +echo "mon_decimal_point: {$locale_info["mon_decimal_point"]}\n"; +echo "mon_thousands_sep: {$locale_info["mon_thousands_sep"]}\n"; +echo "positive_sign: {$locale_info["positive_sign"]}\n"; +echo "negative_sign: {$locale_info["negative_sign"]}\n"; +echo "int_frac_digits: {$locale_info["int_frac_digits"]}\n"; +echo "frac_digits: {$locale_info["frac_digits"]}\n"; +echo "p_cs_precedes: {$locale_info["p_cs_precedes"]}\n"; +echo "p_sep_by_space:{$locale_info["p_sep_by_space"]}\n