fork download
  1. <?php
  2.  
  3. $string = "/var/www*/te'st/test.php";
  4. $string = preg_replace( '/[^A-Za-z0-9\-\\.\/]/', '' , $string );
  5. echo $string;
Success #stdin #stdout 0.02s 23732KB
stdin
Standard input is empty
stdout
/var/www/test/test.php