Wednesday, 18 November 2015

PHP Function to clean data for nice output tutorial

Today I am going to share a very useful php function, Hmm, am happy writing codes, the little have leaned passion for sharing, i was once finding hard times like this. This function is simple most of you know it, maybe they are not, simple php function to clean data for nice output result.


/** * Function to clean data for nice output */function clean( $text ){    return stripslashes( html_entity_decode( nl2br( $text ) ) );}?>



Calling function:

include 'inc.clean.php';

$text=clean($_POST['text']);

That is really helpful;

No comments:

Post a Comment

Hit me with a comment!