In PHP 7.x, ereg functions are no longer supported. Based on my search on internet, ereg functions use a very limited regex flavor called POSIX ERE - meaning pref functions can cover more REGEX syntax as designed. |
Below example shows the alternative method in preg functions
ereg functions | recommended alternative functions | ||||
---|---|---|---|---|---|
eregi( string $pattern , string $string ) : int
| preg_match( string $pattern , string $subject ) : int
| ||||
eregi( string $pattern , string $string ) : int
| preg_match( string $pattern , string $subject ) : int
| ||||
eregi( string $pattern , string $string , array &$regs ) : int
Result
| preg_match( string $pattern , string $subject [, array &$matches [, int $flags = 0 [, int $offset = 0 ]]] ) : int
Result
| ||||
ereg_replace ( string $pattern , string $replacement , string $string ) : string
Result
| preg_replace ( mixed $pattern , mixed $replacement , mixed $subject [, int $limit = -1 [, int &$count ]] ) : mixed
Result
|
Reference URLs