Skip to content
Snippets Groups Projects
Commit 84df3ca6 authored by Prasad's avatar Prasad
Browse files

Added ereg* backward compatability for php7.

parent c046958a
No related branches found
No related tags found
No related merge requests found
......@@ -2321,13 +2321,16 @@ function php7_compat_split($delim, $str, $ignore_case=false) {
return $splits;
}
if (!function_exists('split')) {
function split($delim, $str) { return php7_compat_split($delim, $str); }
}
if (!function_exists('spliti')) {
function spliti($delim, $str) {
return php7_compat_split($delim, $str, true);
}
if (!function_exists('split')) { function split($delim, $str) {return php7_compat_split($delim, $str); } }
if (!function_exists('spliti')) { function spliti($delim, $str) {return php7_compat_split($delim, $str, true);}}
function php7_compat_ereg($pattern, $str, $ignore_case=false) {
$regex = '/'. preg_replace('/\//', '\\/', $pattern) .'/' . ($ignore_case ? 'i': '');
return preg_match($regex, $str);
}
if (!function_exists('ereg')) { function ereg($pattern, $str) { return php7_compat_ereg($pattern, $str); } }
if (!function_exists('eregi')) { function ereg($pattern, $str) { return php7_compat_ereg($pattern, $str, true); } }
?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment