StripSlashesExtended





3
Date Submitted Sat. Jul. 15th, 2006 8:18 PM
Revision 1 of 1
Beginner materix
Tags Slashes | String | Strip
Comments 0 comments
Sometimes you need to remove slashes from POST variables which could contain arrays. The standard slipslashes-function only takes a string as parameter.

This function removes slashes from both a simple string and array variable.


function StripSlashesExtended($value)
{
  if(is_array($value)) 
    foreach($value as $key=>$val)
      $value[$key] = stripslashes($val);
  else
    $value = stripslashes($value);

  return $value;
}
 

E. L.

Comments

There are currently no comments for this snippet.

Voting