谁能解释这个警告?

Sta*_*ers 1 php

警告的含义是什么?

Warning: preg_replace() [function.preg-replace]: Compilation failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1 in
Run Code Online (Sandbox Code Playgroud)

它由这个函数触发:

file_put_contents($file,preg_replace('(\uid=\d+)', 'uid=' . $uid, file_get_contents($file)));
Run Code Online (Sandbox Code Playgroud)

即这种模式:

'(\uid=\d+)'
Run Code Online (Sandbox Code Playgroud)

它在本地工作,但不在线,这意味着它可能是我主机的PHP版本.我试图google一个解决方法,但找不到任何东西.

Geo*_*roy 5

PCRE不支持\uespace序列.

换句话说,你的正则表达式是不正确的.尝试类似的东西(uid=\d+).

正如评论中所说(感谢Mellamokb),这里是源头.

如果你想知道它是什么\u,你可以看看这里

\ u标题下一个字符.不在[].