Timeline for str_starts_with and str_ends_with functions in PHP
Current License: CC BY-SA 4.0
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 1, 2024 at 16:01 | history | edited | dkellner | CC BY-SA 4.0 |
added 276 characters in body
|
| Jun 11, 2024 at 0:29 | comment | added | dkellner | @FrancescoMM – Yes, there are a few people on the planet and it's a pretty obvious idea. | |
| Jun 10, 2024 at 18:09 | comment | added | FrancescoMM |
There is an answer of three years before this, adding the same speedup test at the beginning, and slightly faster. Anyway, if you want to be safe you also need to add if($haysack==="") return false; after the test for $needle, unless you test for $haysack outside the function.
|
|
| Dec 17, 2020 at 8:22 | history | edited | dkellner | CC BY-SA 4.0 |
added 4 characters in body
|
| Dec 17, 2020 at 8:21 | comment | added | dkellner | @Tino I'd say we could remove these 2 comments now, wouldn't you agree? I mean, point taken, it's fixed and it's been 2 years. | |
| Dec 17, 2020 at 8:16 | history | edited | dkellner | CC BY-SA 4.0 |
added 62 characters in body
|
| Dec 17, 2020 at 8:10 | history | edited | dkellner | CC BY-SA 4.0 |
added 62 characters in body
|
| May 2, 2019 at 10:27 | history | edited | dkellner | CC BY-SA 4.0 |
added 31 characters in body
|
| Jul 20, 2018 at 14:44 | history | edited | dkellner | CC BY-SA 4.0 |
added 4 characters in body
|
| Jul 20, 2018 at 14:43 | comment | added | dkellner | Yup, bad !$checking happened. Sorry! (Just wanted to illustrate the concept in line 3) | |
| Jul 20, 2018 at 11:10 | comment | added | Tino |
Bug in your code: startsWith("123", "0") gives true
|
|
| Jul 26, 2016 at 20:02 | history | answered | dkellner | CC BY-SA 3.0 |