Can I run the $_POST array through a loop to get the same result as the following code?
$_POST['manufacturer'] = strip_tags($_POST['manufacturer']);<br>
$_POST['part_no'] = strip_tags($_POST['part_no']);<br>
$_POST['product_name'] = strip_tags($_POST['product_name']);<br>
$_POST['link'] = strip_tags($_POST['link']);<br>
Or is there a way to apply strip_tags() to every field in the $_POST array?
Yes, use array_map()
$_POST = array_map("strip_tags", $_POST);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With