Posted values

Small, short code snippets that other people may find useful. Do you have a good regex that you would like to share? Share it! Even better, the code can be commented on, and improved.

Moderator: General Moderators

Post Reply
User avatar
protokol
Forum Contributor
Posts: 353
Joined: Fri Jun 21, 2002 7:00 pm
Location: Cleveland, OH
Contact:

Posted values

Post by protokol »

I tend to trim() everything that is posted in a form. So instead of using a foreach to go through each value, I do this:

Code: Select all

<?php
$_POST = array_map('trim', $_POST);
?>
Last edited by protokol on Mon Jan 10, 2005 7:25 pm, edited 1 time in total.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Thats a nifty technique.. ill be sure to use it :)
Post Reply