:-)
INPUT:
<?php
$a = array( '0' => 'j', 'fname' => 'j', '1' => 'j', 'lname' => 'j', '2' => 'jj', 'state' => '', '3' => '[EMAIL PROTECTED]', 'email' => '[EMAIL PROTECTED]', '4' => '0', 'newsletter' => '0', );
array_walk($a, create_function('&$v', '$v = ($v=="")?" ":$v;')); print_r($a);
?>
OUTPUT:
[EMAIL PROTECTED] php -f test.php Array ( [0] => j [fname] => j [1] => j [lname] => j [2] => jj [state] => [3] => [EMAIL PROTECTED] [email] => [EMAIL PROTECTED] [4] => 0 [newsletter] => 0 )
Chris W. Parker wrote:
Hey people.
I've got an array like this:
[0] => Array ( [0] => j [fname] => j [1] => j [lname] => j [2] => jj [state] => jj [3] => [EMAIL PROTECTED] [email] => [EMAIL PROTECTED] [4] => 0 [newsletter] => 0 )
Some cells might be empty so i want to replace every empty cell with " ". I can easily do this with just the numerical index but I can't figure out how to do the textual indices also.
Someone have a clue?
Thanks, Chris.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php