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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

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

Post 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
Last edited by tecktalkcm0391 on Tue Jun 20, 2006 11:32 pm, edited 1 time in total.
Robert Plank
Forum Contributor
Posts: 110
Joined: Sun Dec 26, 2004 9:04 pm
Contact:

Post by Robert Plank »

Code: Select all

$badwords = array_map(create_function('$input', 'return array(reset($input));'), $badwords);
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

Post by tecktalkcm0391 »

works! Thanks! :D :D :D
Post Reply