Saturday, 15 September 2012

Trim All Posted Variables in PHP

Quick tip to trim all posted variables in PHP.

<?php
            
            array_walk($_POST, 'trim_posted_variables');
           
           /**
            * function to trim all the posted variables.
            *
            * $param : value - as we are using array_walk function, first parameter
            * in the used function should be value.

            * index - second parameter should be key or index.
            */
            
           function trim_posted_variables($value, $index){

                  $_POST[$index] = trim($value);
   
            }


?>


Thanks!!!!!!!!!!!! Enjoy Programming :)

No comments:

Post a Comment

Thanks for your valuable comments.

Gmail: Download blocked file

Hi, today we are going to learn, how to download blocked file in gmail. Sometimes you see following message in gmail: and you can...