php's strstr () function searches for the first occurrence of a string in another string,And return the rest of the string.
The strstr () function is defined as follows:
strstr (string, search, before_search)
string is required. Specifies the string to be searched.
essential. Specifies the search string.
If this parameter is numeric,Search for characters that match the ascii value for this number.
Optional. The default value is a Boolean value of "false".
If set to "true", it returns the part of the string before the first occurrence of the search parameter.
The sample code is as follows:
<?php echo "<br />"; echo "<br />"; echo strstr ("123456789", "5"); ?>
The results are as follows:
The third optional parameter to the strstr () function is only available after PHP 5.3.Such as:
echo strstr ("123456789", "5", true); //Output:1234
- Examples of common PHP string processing functions [transform, escape, intercept, compare, find, reverse, cut]
- How to find the number of occurrences of a string in php
- Php method to find where string appears through strpos
- Php method using substr () and strpos () jointly to find a specific character in a string
- Summary of the differences between the four functions strstr, strrchr, substr, stristr in PHP
- Strpos, strstr and stripos, stristr function analysis in PHP
- PHP common string search functions strstr () and strpos ()
- python - you may need to restart the kernel to use updated packages error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- python 3x - typeerror: 'method' object is not subscriptable
- i want to call a child component method from a parent in vuejs
- dart - flutter: the instance member'stars' can't be accessed in an initializer error
- xcode - pod install [!] no `podfile 'found in the project directory