Home > Backend Development > PHP Tutorial > Typecho中的路由规则,用 | (或运算符) 做正则的定界符问题

Typecho中的路由规则,用 | (或运算符) 做正则的定界符问题

WBOY
Release: 2016-06-06 20:36:29
Original
1145 people have browsed it

<code>array(6) {
 ["url"] => string(1) "/"
 ["widget"] => string(14) "Widget_Archive"
 ["action"] => string(6) "render"
 ["regx"] => string(8) "|^[/]?$|"
 ["format"] => string(1) "/"
 ["params"] => array(0) {
  }
}</code>
Copy after login
Copy after login

regx中的值是用|斜杠做定界符,不是用/或#吗?preg_match()函数

回复内容:

<code>array(6) {
 ["url"] => string(1) "/"
 ["widget"] => string(14) "Widget_Archive"
 ["action"] => string(6) "render"
 ["regx"] => string(8) "|^[/]?$|"
 ["format"] => string(1) "/"
 ["params"] => array(0) {
  }
}</code>
Copy after login
Copy after login

regx中的值是用|斜杠做定界符,不是用/或#吗?preg_match()函数

题目取的不好,自己看手册吧 http://php.net/manual/zh/regexp.reference.delimiters.php

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