How to redefine a function if it doesn't exist?

From: Date: Tue, 30 Mar 2010 13:16:57 +0000
Subject: How to redefine a function if it doesn't exist?
Groups: php.general 
Request: Send a blank email to php-general+get-303611@lists.php.net to get a copy of this message
Hello everyone, Sorry, I've forgotten how to do this... I need a quoted_printable_encode function but it's available only since PHP 5.3. How do I redefine that function only if PHP version is lower than 5.3? Would it be valid: function quoted_printable_encode ($str) { $x=quoted_printable_encode ($str); if (!isset($x)) { // blah blah, alternative code } else { return $x; } } Is it valid code or not?) Thanks! -- With best regards from Ukraine, Andre Http://oire.org/ - The Fantasy blogs of Oire Skype: Francophile; Wlm&MSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: http://twitter.com/m_elensule

« previous php.general (#303611) next »