Home > Backend Development > PHP Tutorial > PHP method to determine the position of a string in another string_PHP tutorial

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 10:36:52
Original
877 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:
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template