The str_replace page had a helpful note that if you'd somehow got
there when you were looking for preg_replace, you didn't need to
llok further. But if you were actually on the page for preg_replace,
there was no link to str_replace at all, not even in the See Also
section.
* random: Reference the corresponding Randomizer methods in random_(bytes|int)
* random: Cross-reference the Randomizer in `str_shuffle()`
* random: Cross-reference the Randomizer in `shuffle()`
* random: Cross-reference the Randomizer in `array_rand()`
* random: Cross-reference `random_bytes()` in `uniqid()`
* random: Do not cross-reference `uniqid()` in `openssl_random_pseudo_bytes()`
uniqid() really is no good alternative to *anything*. In the vast majority of
cases it is better replaced by `bin2hex(random_bytes(…))`.
* random: Replace the `mt_rand()` cross-reference in `openssl_random_pseudo_bytes()` with `random_int()`
random_int() is a CSPRNG like openssl_random_pseudo_bytes(), mt_rand() is not.
* Add a detailed description of what is meant by ASCII case conversion
to strtolower() and strtoupper().
* Replace locale-related text on ucfirst(), lcfirst() and ucwords()
with text about ASCII case conversion.
* Remove entity note.locale-single-byte since it was only used on
ucwords().
* Add changelog entries to all the functions mentioned in the RFC.
Co-authored-by: George Peter Banyard <girgias@php.net>
- Move utf8_encode and utf8_decode into the strings chapter, since
they were moved out of the XML extension in 7.2
- Recommend mb_convert_encoding, iconv, and UConverter::transcode
when mentioning encoding in passing
- Document UConverter::transcode, based on examination of source
and upstream ICU docs
- Make the language used more consistent, e.g. "convert" rather
than "encode"/"decode", "encoding" rather than "charset"
Closes GH-1418.
Length parameter to substr() behaves differently for PHP8+. It recognizes null as if no value was provided at all. Updated the documentation to reflect this.
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Closes GH-1219.
* strspn(): Use proper parameter names in docs reference
Commit e095023e40 renamed the `$subject`, `$mask`, and `$start` parameters of the `strspn()` function to `$string`, `$characters`, and `$offset`, respectively. The three instances in the code example were missed.
* strcspn(): Use proper parameter names in docs reference
Commit e095023e40 renamed the `$subject`, `$mask`, and `$start` parameters of the `strcspn()` function to `$string`, `$characters`, and `$offset`, respectively. The three instances in the code example were missed.
Closes GH-977.