.. _structures-usestrstartswith: .. _use-str\_starts\_with(): Use str_starts_with() +++++++++++++++++++++ There is a dedicated function to check the prefix of a string : it is called `str_starts_with() `_. It is available since PHP 8.0 .. code-block:: php See also `str_ends_with() `_. Suggestions ___________ * Use the native PHP function Specs _____ +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Short name | Structures/UseStrStartsWith | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Changed Behavior `, :ref:`Suggestions ` | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 2.5.2 | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | PHP Version | With PHP 8.0 and more recent | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Severity | Minor | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Quick (30 mins) | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Precision | High | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+-------------------------------------------------------------------------------------------------------------------------+