Get the App
SLTechnology News&Howtos  ›  Development  › 

The usage of str_starts_with () function in PHP

Shulou Source: shulou.com Published: 2022-06-03 17:22:34 10月24日 Update

This article mainly introduces "the use of str_starts_with () function in PHP". In daily operation, I believe that many people have doubts about the use of str_starts_with () function in PHP. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "the use of str_starts_with () function in PHP". Next, please follow the editor to study!

1. Str_starts_with () is a predefined function in PHP8 that performs a case-sensitive search on a given string.

Usually check to see if the string begins with a substring.

2. If the string begins with a substring, str_starts_with () returns TRUE, otherwise it returns FALSE.

Syntax:

Str_starts_with ($string, $substring)

String: this parameter refers to the string that needs to be checked for the starting string.

Substring: this parameter refers to the string that needs to be checked.

Return value: if the string begins with a substring, str_starts_with () returns TRUE otherwise it returns FALSE.

Example

At this point, the study of "how to use the str_starts_with () function in PHP" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Characters strings functions methods usage learning beginning checking parameters more help practical next size examples articles theories knowledge articles websites Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft macOS Xiaomi NVidia MariaDB