PHP intercepts a method that specifies a string between 2 characters _php
Source: Internet
Author: User
KeywordsPHP Intercept string
This article describes a method by which PHP intercepts a string specified between 2 characters. Share to everyone for your reference. Specific as follows:
In PHP just judge the string 1 and the string 2 before the Stripos position and then use SUBSTR to start interception, here is a simple example.
The following is the completion of the above used string intercept function Getneedbetween. The function implements a simple string ($kw) to intercept two specified characters ($mark 1, $mark 2) between the strings, the failure returns 0, and the truncated string is successfully returned.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.