Re: my checkbox array striped ?

From: Date: Thu, 04 Mar 2004 01:12:41 +0000
Subject: Re: my checkbox array striped ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-179405@lists.php.net to get a copy of this message
Hello adwinwijaya, Wednesday, March 3, 2004, 11:27:44 PM, you wrote: a> as you can see the type should be an array ... but it just displaying a> Array .... a> if I remove strip_tags from my script it will work perfectly (it will a> display the checkbox array) ... a> can someone explain to me why this happen ? I just want to strip tags a> every input the user entered ... strip_tags() returns a string, you're passing an array into it, so it is returning Array. The strip tags function cannot work with arrays, you need to give it a string. Here is a technique I use to iterate through a $_POST array, it should work for you too: <?php function strip (&$item1, $key) { $item1 = strip_tags($item1); } array_walk($_POST, 'strip'); ?> If an element of $_POST is an array this won't work, you would need to do something like: array_walk($_POST['array_name'], 'strip') for that particular array instead. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html

« previous php.general (#179405) next »