Re: help with arrays

From: Date: Tue, 23 Sep 2003 20:43:14 +0000
Subject: Re: help with arrays
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-163631@lists.php.net to get a copy of this message
It doesn't get much simpler :) foreach( $data as $key => $value ) { if( $value == '' ) { $data[$key] = ' ' } } Cheers, Rob. On Tue, 2003-09-23 at 16:38, 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] => j@domain.com > [email] => j@domain.com > [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 > > -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

« previous php.general (#163631) next »