
22.04.2010, 23:26
|
|
Он хакер.
Регистрация: 01.11.2008
Сообщений: 1,756
С нами:
9223466
Репутация:
3171
|
|
Сообщение от Welemir
Что означает $0*$0 ?
Это особая, уличная магия.
http://php.net/manual/en/function.preg-replace.php
Added the '$n' form for the replacement parameter
Код:
When working with a replacement pattern where a backreference is immediately followed by another number (i.e.: placing a literal number immediately after a matched pattern), you cannot use the familiar \\1 notation for your backreference. \\11, for example, would confuse preg_replace() since it does not know whether you want the \\1 backreference followed by a literal 1, or the \\11 backreference followed by nothing. In this case the solution is to use \${1}1. This creates an isolated $1 backreference, leaving the 1 as a literal.
When using the e modifier, this function escapes some characters (namely ', ", \ and NULL) in the strings that replace the backreferences. This is done to ensure that no syntax errors arise from backreference usage with either single or double quotes (e.g. 'strlen(\'$1\')+strlen("$2")'). Make sure you are aware of PHP's string syntax to know exactly how the interpreted string will look like.
|
|
|