Passing arguments to an internal function via array_map

From: Date: Thu, 10 Nov 2011 16:10:31 +0000
Subject: Passing arguments to an internal function via array_map
Groups: php.general 
Request: Send a blank email to php-general+get-315626@lists.php.net to get a copy of this message
Hi folks, I'm trying to convert the contents of an array from utf8 to utf16 (thanks for the headache MS Excel!). I originally created a "user function" that just ran the text through mb_convert_encoding($text,'utf-16','utf-8') but now I'm wondering if I can't just use the internal function directly. Apparently it's more complicated when the function requires arguments; I see example using mysql_real_escape_string() on php.net. My current attempt looks like this: $clean = array_map('mb_convert_encoding', $dirty_arr, array('utf-16','utf-8')); but I believe this is actually passing an array to mb_convert_encoding() as the second argument rather than the 2nd and 3rd... Any ideas or am I chasing something that can't be done? Marc

« previous php.general (#315626) next »