php判断字符串在另一个字符串位置的方法_PHP

WBOY
Release: 2016-06-01 11:56:14
Original
1064 people have browsed it

复制代码 代码如下:
$email='user@exe.com';        //定义字符串
$result=strstr($email,'@');         //返回子字符串
echo $result;

strstr()函数搜索一个字符串在另一个字符串中的第一次出现。

该函数返回字符串的其余部分(从匹配点)。如果未找到所搜索的字符串,则返回 false。

语法
复制代码 代码如下:

strstr(string,search)
输出结果"@exe.com"

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!