Notes about upgrading to PhP 5.3.3.
ereg
functions are now deprecatedpreg
:
eregi("xxx") -> preg_match('@xxx@i')
@
is used to start and the pattern.
Any character can be used, we use @
so
as to not match /
i
indicates that the search is case insensitive.
See Pattern Modifiers
ereg_replace -> preg_replaceSame rules as above about start and end
s
modifier to match newlines in a multiline expression.<!--margin-->
directives in the toc files, html.inc.php
had lines like
if (eregi("(.*)", $toc, $tmp)) {The proper replacement is
if (preg_match("@(.*)@is", $toc, $tmp)) {Note that the regex ends in
is
, which means
case insensitive "dot metacharacter in the pattern matches all characters, including newlines."