PHP method to determine the position of a string in another string_PHP tutorial

WBOY
Release: 2016-07-13 10:36:52
Original
800 people have browsed it

Copy code The code is as follows:

$email='user@exe.com'; //Define string
$result=strstr($email,'@'); //Return substring
echo $result;

The strstr() function searches for the first occurrence of a string in another string.

This function returns the rest of the string (from the matching point). Returns false if the searched string is not found.

Syntax

Copy code The code is as follows:


strstr(string,search)
Output result "@exe.com"

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/736843.htmlTechArticleCopy the code as follows: $email='user@exe.com'; //Define string $result= strstr($email,'@'); //Return substring echo $result; The strstr() function searches a string within another character...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!