Page 1 of 1

Can't Find anything about Dropping Array Values [SOLVED]

Posted: Tue Jun 20, 2006 11:23 pm
by tecktalkcm0391
How could I turn an array like this:

Code: Select all

$badwords = array();
	$badwords[] = array('words', ' * ');
	$badwords[] = array('bad', ' * ');
to just

Code: Select all

$badwords = array();
	$badwords[] = array('words');
	$badwords[] = array('bad');
I couldn't find anything in the manual

Posted: Tue Jun 20, 2006 11:28 pm
by Robert Plank

Code: Select all

$badwords = array_map(create_function('$input', 'return array(reset($input));'), $badwords);

Posted: Tue Jun 20, 2006 11:31 pm
by tecktalkcm0391
works! Thanks! :D :D :D