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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php