louis_coetzee Posted September 8, 2009 Share Posted September 8, 2009 Hi, I had to re-install my wampserver, probably a new version, now I get this new error: Deprecated: Function eregi() is deprecated in C:\wamp\www\age_art\new\models\products.php on line 8 This is: products.php <?php function image_list($image_dir) { $fileCount = 1; $dir = opendir($image_dir); while ($file = readdir($dir)) { if (eregi("\.jpg",$file)) { $image_array[$fileCount] = $file; $fileCount++; } } return $image_array; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/173558-solved-deprecated-function-eregi-is-deprecated-in-cwampwwwage_artnewmodelspro/ Share on other sites More sharing options...
TeNDoLLA Posted September 8, 2009 Share Posted September 8, 2009 It means the function is old and not supposed to use anymore. I don't remember the versions where this still was or where it was removed but thats probably the case. You should use preg_match. And instead of all ereg* functions there is usually preg_* function that you can use. You can use the i -modifier to get it work incase sensitive. <?php if (preg_match('/.jpg/i', $file)) Quote Link to comment https://forums.phpfreaks.com/topic/173558-solved-deprecated-function-eregi-is-deprecated-in-cwampwwwage_artnewmodelspro/#findComment-914844 Share on other sites More sharing options...
louis_coetzee Posted September 8, 2009 Author Share Posted September 8, 2009 It means the function is old and not supposed to use anymore. I don't remember the versions where this still was or where it was removed but thats probably the case. You should use preg_match. And instead of all ereg* functions there is usually preg_* function that you can use. You can use the i -modifier to get it work incase sensitive. <?php if (preg_match('/.jpg/i', $file)) Thanks a lot. Solved! Quote Link to comment https://forums.phpfreaks.com/topic/173558-solved-deprecated-function-eregi-is-deprecated-in-cwampwwwage_artnewmodelspro/#findComment-914848 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.