Re: [PHP-DEV] Proposal for a new basic function: str_contains

This is only part of a thread. view whole thread
February 14, 2020 11:41 (Claude Pache)
> Le 14 févr. 2020 à 10:17, Philipp Tanlak> a écrit : > > Hello PHP Devs, > > I would like to propose the new basic function: str_contains. > > The goal of this proposal is to standardize on a function, to check weather > or not a string is contained in another string, which has a very common > use-case in almost every PHP project. > PHP Frameworks like Laravel create helper functions for this behavior > because it is so ubiquitous.
Some time ago, an RFC proposing to add str_starts_with() and str_ends_with() was unfortunately declined: <> Therefore, unless several people have changed their mind in the right direction since few months ago, I am pessimistic about the acceptance of str_contains(). —Claude