note 47428 added to function.iconv

From: Date: Tue, 16 Nov 2004 07:53:07 +0000
Subject: note 47428 added to function.iconv
Groups: php.notes 
Request: Send a blank email to php-notes+get-80580@lists.php.net to get a copy of this message
On some systems there may be no such function as iconv(); this is due to the following reason: a constant is defined named iconv with the value libiconv. So, the string PHP_FUNCTION(iconv) transforms to PHP_FUNCTION(libiconv), and you have to call libiconv() function instead of iconv(). I had seen this on FreeBSD, but I am sure that was a rather special build. If you'd want not to be dependent on this behaviour, add the following to your script: <?php if (!function_exists('iconv') && function_exists('libiconv')) { function iconv($input_encoding, $output_encoding, $string) { return libiconv($input_encoding, $output_encoding, $string); } } ?> Thanks to tony2001 at phpclub.net for explaining this behaviour. ---- Manual Page -- http://www.php.net/manual/en/function.iconv.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47428 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47428&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47428&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47428&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47428&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47428&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47428&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47428&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#80580) next »