Jump to content

applying functions in order


graham23s

Recommended Posts

Hi GUys,

 

i wrote this basic function to deal with the ' and line breaks but im never sure in which order to apply them:

 

<?php
function clean_junk($string)
{
  // apply the functions //
  $string = nl2br(stripslashes($string));
        
  // return the string cleansed //         
  return mysql_real_escape_string($string);
}
?>

 

i never remember in which order to apply them or does it matter?

 

nl2br(stripslashes or stripslashes(nl2br

 

just incase it does matter lol

 

cheers

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/103048-applying-functions-in-order/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.