<?php
$string = "/var/www*/te'st/test.php";
$string = preg_replace( '/[^A-Za-z0-9\-\\.\/]/', '' , $string ); echo $string;
PD9waHAKCiAgICAkc3RyaW5nID0gIi92YXIvd3d3Ki90ZSdzdC90ZXN0LnBocCI7CiAgICAkc3RyaW5nID0gcHJlZ19yZXBsYWNlKCAnL1teQS1aYS16MC05XC1cXC5cL10vJywgJycgLCAkc3RyaW5nICk7CiAgICBlY2hvICRzdHJpbmc7