worldcomingtoanend Posted October 7, 2009 Share Posted October 7, 2009 i am creating a search engine and i am getting the above error..what could it mean...if u need more information let me know. Quote Link to comment https://forums.phpfreaks.com/topic/176805-solved-deprecated-function-eregi_replace-is-deprecated-in-cjkjjhj-line-37/ Share on other sites More sharing options...
Zane Posted October 7, 2009 Share Posted October 7, 2009 Definition of deprecated # In computer software standards and documentation, the term deprecation is applied to software features that are superseded and should be avoided. ... en.wikipedia.org/wiki/Deprecated # Strongly disapproved of; Belittled; insulted; Obsolescent; said of a construct in a computing language considered obsolete but still available ... en.wiktionary.org/wiki/deprecated # deprecation - the act of expressing disapproval (especially of yourself) wordnetweb.princeton.edu/perl/webwn # deprecating - In manner that deprecates; insulting; belittling en.wiktionary.org/wiki/deprecating # deprecate - to express disapproval of; to recommend against use of; to pray against en.wiktionary.org/wiki/deprecate # deprecation - The act of deprecating; A praying against evil; prayer that an evil may be removed or prevented; strong expression of disapprobation; Entreaty for pardon; petitioning; An imprecation or curse en.wiktionary.org/wiki/deprecation # functions or template tags are no longer supported, and will soon be obsolete. codex.wordpress.org/Glossary # A deprecated element or attribute is one that has been outdated by newer constructs. Deprecated elements may become obsolete in future versions of HTML . Authors should avoid using deprecated elements and attributes. ... www.d.umn.edu/itss/support/Training/Online/webdesign/glossary/d.html preg_replace is the way of teh future man. Quote Link to comment https://forums.phpfreaks.com/topic/176805-solved-deprecated-function-eregi_replace-is-deprecated-in-cjkjjhj-line-37/#findComment-932201 Share on other sites More sharing options...
Mark Baker Posted October 7, 2009 Share Posted October 7, 2009 It means that very soon the eregi_replace() function will no longer exist in PHP at all, it is superseded by preg_replace(), and you should be using that function instead Quote Link to comment https://forums.phpfreaks.com/topic/176805-solved-deprecated-function-eregi_replace-is-deprecated-in-cjkjjhj-line-37/#findComment-932203 Share on other sites More sharing options...
worldcomingtoanend Posted October 7, 2009 Author Share Posted October 7, 2009 thank you for the clarification and now i have set up this code below and how do i rewrite the line with eregi_replace using the new preg_replace. becoz i simply substituted eregi_replace with preg_replace and I am getting errors about my delimiters but i am not sure what to do. Hope u can help. these are the 2 lines: $site_url = eregi_replace('index.php', '', $full_url); and $label = eregi_replace('_', ' ', $getdirArray[$dir]); and the full code below: $hits = null; $full_url = $_SERVER['PHP_SELF']; $site_url = eregi_replace('index.php', '', $full_url); $directory_list = array('data', 'moredata'); foreach($directory_list as $dirlist) { $directory_url = $site_url.$dirlist."/"; $getDirectory = opendir($dirlist); while($dirName = readdir($getDirectory)) $getdirArray[] = $dirName; closedir($getDirectory); $dirCount = count($getdirArray); sort($getdirArray); for($dir=0; $dir < $dirCount; $dir++) { if (substr($getdirArray[$dir], 0, 1) != ".") { $label = eregi_replace('_', ' ', $getdirArray[$dir]); $directory = $dirlist.'/'.$getdirArray[$dir]."/"; $complete_url = $site_url.$directory; if(is_dir($directory)) { $myDirectory = opendir($directory); $dirArray = null; while($entryName = readdir($myDirectory)) $dirArray[] = $entryName; closedir($myDirectory); $indexCount = count($dirArray); sort($dirArray); } Quote Link to comment https://forums.phpfreaks.com/topic/176805-solved-deprecated-function-eregi_replace-is-deprecated-in-cjkjjhj-line-37/#findComment-932214 Share on other sites More sharing options...
Zane Posted October 7, 2009 Share Posted October 7, 2009 delimiters are something you use in PCRE regex (the "preg functions") other than POSIX regex (the "ereg functions") for example.. $string = "I eat deer" preg_replace("/deer/", 'dogs', $string); would be done like this in "ereg" form $string = "I eat deer" ereg_replace("deer", 'dogs', $string); notice the difference? the slashes. // you can also use !@#$%^&* (all those wacky characters where the numbers are... holding SHIFT) what's the strategy in it? To keep you from having to escape slashes. Quote Link to comment https://forums.phpfreaks.com/topic/176805-solved-deprecated-function-eregi_replace-is-deprecated-in-cjkjjhj-line-37/#findComment-932219 Share on other sites More sharing options...
worldcomingtoanend Posted October 7, 2009 Author Share Posted October 7, 2009 thank you soo much zanus you are indeed a star, my search engine is now up and running. But honestly why did they make the new preg_replace() so complicated. I think the old one eregi_replace() was simple..u didnt need to use all those delimiter things. thanks and hv a nice day. Quote Link to comment https://forums.phpfreaks.com/topic/176805-solved-deprecated-function-eregi_replace-is-deprecated-in-cjkjjhj-line-37/#findComment-932224 Share on other sites More sharing options...
Mark Baker Posted October 7, 2009 Share Posted October 7, 2009 But honestly why did they make the new preg_replace() so complicated. I think the old one eregi_replace() was simple..u didnt need to use all those delimiter things.When you get used to it, it's no more difficult for simple regular expressions (just a couple of extra characters); supports more complex regular expressions; you only need one function for case-sensitive and for case-insensitive (not two different functions); it's a lot faster than the old ereg_replace Quote Link to comment https://forums.phpfreaks.com/topic/176805-solved-deprecated-function-eregi_replace-is-deprecated-in-cjkjjhj-line-37/#findComment-932240 Share on other sites More sharing options...
worldcomingtoanend Posted October 7, 2009 Author Share Posted October 7, 2009 thanks for that information i was really wondering. i also implemented your error code u specified and yes yes it worked for me.... Quote Link to comment https://forums.phpfreaks.com/topic/176805-solved-deprecated-function-eregi_replace-is-deprecated-in-cjkjjhj-line-37/#findComment-932242 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.