


PHP uses substr() and strpos() to jointly find a specific character in a string, substrstrpos_PHP tutorial
Jul 13, 2016 am 09:54 AMphp uses substr() and strpos() to jointly find a specific character in a string, substrstrpos
The example in this article describes the use of substr() and strpos() in php A method to jointly find a specific character in a string. Share it with everyone for your reference. The specific analysis is as follows:
Requirement: Find the characters before the double vertical bar in the string below. Most of the clearing uses the explode() function, but too many explode()s were used during the project, so the following method was found.
1 2 3 4 |
|
The output content is admin.
Detailed description of substr(): http://www.bkjia.com/w3school/php/func_string_substr.htm
Detailed description of strpos(): http://www.bkjia.com/w3school/php/func_string_strpos.htm
I hope this article will be helpful to everyone’s PHP programming design.

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

How To Set Up Visual Studio Code (VS Code) for PHP Development
