2012. 11. 20. 01:16ㆍLanguages/PHP
If you upgraded to PHP 5.3, chances are high you’re going to run into a few warnings or deprecated function messages.
An example is the ereg
family of functions, which are gone for good, as they were slower and felt less familiar than the alternative Perl-compatible preg
family.
To migrate ereg()
:
becomes
Notice that I wrapped the pattern (\.([^\.]*$)
) around / /
, which are RegExp delimiters. If you find yourself escaping /
too much (for an URL for example), you might want to use the #
delimiter instead.
To migrate ereg_replace()
:
becomes
Again, I just added delimiters to the pattern.
If you are using eregi
functions (which are the case-insensitive version of ereg), you’ll notice there’re no equivalent pregi functions. This is because this functionality is handled by RegExp modifiers.
Basically, to make the pattern match characters in a case-insensitive way, append i
after the delimiter:
becomes
'Languages > PHP' 카테고리의 다른 글
Fatal error: Call to undefined function socket_create() in C:\APM_Setup\htdocs\port.php on line 16 (0) | 2013.06.07 |
---|---|
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 8414921 bytes) (0) | 2012.11.20 |
[PHP] Assigning the return value of new by reference is deprecated (0) | 2012.11.20 |
php 서버 시간 설정 관련 오류 (strtotime,date ..) (0) | 2012.11.20 |
html 태그 제거 (0) | 2012.11.20 |