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

This is only part of a thread. view whole thread
  108568
February 14, 2020 11:41 claude.pache@gmail.com (Claude Pache)
> Le 14 févr. 2020 à 10:17, Philipp Tanlak tanlak@gmail.com> 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: https://wiki.php.net/rfc/add_str_begin_and_end_functions <https://wiki.php.net/rfc/add_str_begin_and_end_functions> 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