Wednesday, February 9, 2011

STRIPSLASHES sub function in PERL

Here's a simple PERL function with REGEX implementation to do stripslashes (a PHP function).

#!/usr/bin/perl

sub stripslashes
{
   my ($string) = @_;

   $string =~ s/\\(\'|\"|\\)/$1/g;
   return $string;
}


1;

No comments:

Post a Comment