> Le 8 juil. 2019 à 15:20, Christoph M. Becker <cmbecke...@gmx.de> a écrit : > > FTR, there is already substr_compare().
`substr_compare()` (as well as `strncmp()` which I am currently using in lieu of `str_starts_with()`) forces you to provides the substring and the length of the substring, instead of just the substring: substr_compare('foobarbaz', 'foo', 0, 3) === 0 strncmp('foobarbaz', 'foo', 3) === 0 str_starts_with('foobarbaz', 'foo') —Claude