怎么判断一个字符串是否存在txt里面

WBOY
Release: 2016-06-13 13:10:27
Original
1158 people have browsed it

如何判断一个字符串是否存在txt里面
js.txt 内容是


13600000000
13788888888
13666666666
18999999999

我想判断

$mobile = "13788888888";

是否存在 txt里面




------解决方案--------------------
$s=file_get_contents('js.txt');
if(strpos($s,$mobile) !==false) echo '存在';
else echo '不存在';

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