Andrei Zmievski
92d61459c0
@- Fixed an infinite loop in setlocale() when only invalid locale names
@ were passed in the array. (patch by Pal Loberg, pallo@initio.no ).
24 years ago
Ilia Alshanetsky
30c16baac2
Renamed word_count to str_word_count to comply with naming conventions.
Thanks Andi, for catching this oversight.
24 years ago
Ilia Alshanetsky
47b57f2569
Added word_count() function that allows counting of words inside a string.
The function also allows the user to retrieve all the words from a string.
24 years ago
Sander Roobol
524c9ef26a
Fixed problems with the new nl2br() and beautified the code a little.
Closes #19858 .
24 years ago
Ilia Alshanetsky
287b7f9bcb
Switched from localeconv to localeconv_r, which is apparently thread-safe.
24 years ago
Andrey Hristov
cd282dad98
ws fixes
24 years ago
Ilia Alshanetsky
bc14a6f133
This patch fixes handling of floats on locales where decimal point is not a
'.'. Problem is best demonstrated by bug #17079 .
24 years ago
Andrey Hristov
868ae8b6e0
ws fixes.
24 years ago
Ilia Alshanetsky
a75eb9c4dd
Optimizations to various php string functions substr_count(), strrev(),
nl2br(), php_addslashes() and php_memnstr().
24 years ago
Andrey Hristov
16a82f2b47
Returning to the old behavior of str_shuffle() a bit. Now the passed string is
left unmodified and the shuffled string is returned.
24 years ago
Andrey Hristov
0ad8b4aa10
Now str_shuffle() has the randomization characteristics of shuffle().
str_shuffle() won't return anymore the randomized string and thus will be
consistent with shuffle(). Since this function is new to 4.3.0 no BC
problems.
#Thanks to Adam Trachtenberg for providing good example to check the
#permuations distribution.
24 years ago
Sander Roobol
004d3d3a30
Fix another leak in implode()
24 years ago
Sander Roobol
68cd067670
Fixed segfault and memory leak in the new implementation of implode()
24 years ago
Sterling Hughes
df837e67c7
have implode use the smart_str_*() functions, this should speed things up
quite a bit...
24 years ago
Sander Roobol
e6e2c1c70d
Fixed a bug in the new implementation of str_repeat()
24 years ago
Derick Rethans
ec6713f1ca
- dot :)
24 years ago
Sterling Hughes
5605dcf7b6
fix a memory leak in implode()
# kept seperate from last commit on purpose.. ;)
24 years ago
Sterling Hughes
abc9991925
@ Make the glue argument to implode() optional, if it is not specified
@ default to using "". (Sterling)
24 years ago
Andrey Hristov
52c529c5af
ws fixes.
#again :)
24 years ago
Ilia Alshanetsky
2ea2b662a4
Optimized str_repeat() function, it is now 10x faster on 1 byte multipliers
and 5-6x faster on multi-byte multipliers.
24 years ago
Yasuo Ohgaki
f6dfd6b184
Forgot 1 byte for \0
24 years ago
Yasuo Ohgaki
5f1bb18c36
Save memory
24 years ago
Andrey Hristov
83a0f20381
Making strrchr() binary safe.
Test case added.
24 years ago
Andrey Hristov
2092d80230
Making strstr() binary safe.
24 years ago
Andrey Hristov
b2d93b67fc
Ws fix. Forgot to add this in the previous commit.
24 years ago
Andrey Hristov
f02b1507dc
ws fixes.
24 years ago
Sebastian Bergmann
fd7326395b
Fix warning.
24 years ago
Andrey Hristov
f80a817f7c
Added common handler for strspn() and strcspn(). Almost of the code is
identical. Modified to accept up to 4 params. Last 2 optional start & len.
They are analogic to start & len of substr(). So the behavior when start &
len are used is like
strspn(substr($s,$start,$len),$good_chars) and
strcspn(substr($s,$start,$len), $bad_chars)
24 years ago
Andrey Hristov
fc46a46b06
str_shuffle() function added. Like shuffle() for arrays - however the
algorithm for creating the permutation is quite simple. More like
the implementation of shuffle() for 4.2.1 .
24 years ago
Sebastian Bergmann
fd329d2cd1
Fix warning.
24 years ago
Ilia Alshanetsky
8fc94a082f
Fixed bug #7472 as well as many other bugs with strip_tags implementation.
24 years ago
Ilia Alshanetsky
bc8eda5385
Fixed bugs #12989 and #12120
24 years ago
Hartmut Holzgraefe
f8358b44d1
setlocale() will now accept multiple locale arguments, first match wins
24 years ago
foobar
746c147670
tok tok..
24 years ago
foobar
daf6a5ab1a
ws fix
24 years ago
foobar
be52343850
fix proto
24 years ago
Dan Kalowsky
e560822fa7
silence a windows build warning
24 years ago
Ilia Alshanetsky
eb58557e1c
Fixed a buffer overflow that occurs when wordwrap is unable to calculate
the correct number of times the multi-byte break needs to be inserted into
the string.
24 years ago
Derick Rethans
60dcc761ac
- php_error -> php_error_docref
- corrected proto of implode() (to match the docs)
24 years ago
Hartmut Holzgraefe
101d155baa
in stristr:
this check was in the wrong place, the real version was some lines
below, this one assumed the type was 'string' in any case
now it looks like strstr
24 years ago
Ilia Alshanetsky
64ef43ecd4
Slight optimization of php_strtoupper & php_strtoupper functions.
24 years ago
Wez Furlong
c7be7b55d1
Add a "closing" parameter for filters to determine if a flush is the last
flush before the stream is closed. This allows filters to finish a chunk
and write footers etc.
24 years ago
Marcus Boerger
149ad05b4f
php_error_docref
#New conversion available at: http://docref.txt.marcus-boerger.de
24 years ago
Ilia Alshanetsky
ea1bb5e172
Added monetary.h to prevent compile warning.
Fixed a memory leak inside money_format function, which occures if the
parameters to the function are not valid.
Fixed a segmentation fault inside money_format in the event the value
to be formated is >1024 bytes.
Made the return value of money_format be null terminated.
24 years ago
Sebastian Bergmann
090e30a863
Fix ZTS build.
24 years ago
Wez Furlong
9d348ea800
Implement filter API for streams.
Filters can be stacked onto a stream; more details will follow in docs and
on php-dev.
Implement "string.rot13" filter
Allows the following script:
$fp = fopen("file.txt", "r");
stream_filter_prepend($fp, "string.rot13");
// File contents will be subject to a rot13 transformation before
// being output.
fpassthru($fp);
fclose($fp);
24 years ago
Hartmut Holzgraefe
e5fa36eee4
added money_format() function
this is similar to C-libs strfmon(), using the same format string
semantics but a different function prototype, so i decided to
give it a more speaking name similar to number_format()
24 years ago
Rui Hirokawa
7527bf0c58
made sapi_register_treat_data() to support multibyte input encoding translation without MBSTR_ENC_TRANS and changed php_treat_data to php_default_treat_data.
24 years ago
Rasmus Lerdorf
d56bc7934d
Fix for #18638 (str_rot13 bug)
24 years ago
foobar
2f8dc7a47c
- Made the trim functions use same base function. (less code :)
- Renamed php_trim2 -> php_trim (not used anyplace else, yet)
- Made php_trim abit more usable for external use. (not necessary to use
zvals with it anymore)
24 years ago