- 2
- 0
- 约1.19千字
- 约 6页
- 2017-06-18 发布于贵州
- 举报
PHP网络编程MySQL数据库
第三单元 字符串正则表达式(选学) 内容:(第3章) 格式化字符串 字符串的连接与分割 字符串的比较 字符串的查找和替换 正则表达式 正则表达式(Regular Expression)?p5-20章 用于搜索分析检测文本内容(逻辑规则表达)? 2字符串的检查 ?int ereg(string 样本字符,string 字符串[,array regs]) 例20-1 ?php$date=2003-01-31;if (ereg (([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}), $date, $regs)) {echo $regs[3] / $regs[2] / $regs[1] p;echo $regs[0] p;echo $regs[1]年 $regs[2]月 $regs[3]日;} else {echo 不合法的日期格式:$date;}?? 3 文字替换 string ereg_replace(string 样本字符,string 替代文字,string字符串) 例20-3 ?php$string = This is a test. That is another test.;echo ereg_replace ( is, was, $string).P;echo ereg_replace ( is, B is
原创力文档

文档评论(0)