random1 Posted February 16, 2010 Share Posted February 16, 2010 Hey All, How do you override PHP methods in PHP? I'd like to override 'strtolower' with a utf-8 compliant method. Do I simply redeclare the function with new logic? Link to comment https://forums.phpfreaks.com/topic/192220-overriding-php-methods/ Share on other sites More sharing options...
premiso Posted February 16, 2010 Share Posted February 16, 2010 PHP does not allow overriding. You have two options that I know of. 1: Re-compile PHP with your new logic. 2: Create a new function with a different name that has the logic you want (IE: create a function strtolower_utf8) Link to comment https://forums.phpfreaks.com/topic/192220-overriding-php-methods/#findComment-1012951 Share on other sites More sharing options...
PFMaBiSmAd Posted February 16, 2010 Share Posted February 16, 2010 These two links might or might not help - http://www.php.net/manual/en/mbstring.overload.php http://www.php.net/manual/en/function.mb-strtolower.php Link to comment https://forums.phpfreaks.com/topic/192220-overriding-php-methods/#findComment-1012961 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.