Home > Backend Development > PHP Tutorial > spliti和ereg用新函数preg_split(),preg_match()怎么重写下面两句话

spliti和ereg用新函数preg_split(),preg_match()怎么重写下面两句话

WBOY
Release: 2016-06-23 13:29:27
Original
1043 people have browsed it

1,$sql=select * from huiyuan where id=1;
       list($sel, $sql) = spliti("FROM", $sql);


2,if (!ereg("^[0-9]+$",$id12) {$a=1;}


回复讨论(解决方案)

1、

 list($sel, $sql) = preg_split("/FROM/i", $sql);
Copy after login

2、
if (!preg_match("/^[0-9]+$/",$id12)) {$a=1;}
Copy after login

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