PHP Tips && Tricks: Difference between revisions
From D3xt3r01.tk
Jump to navigationJump to search
Line 7: | Line 7: | ||
return trim($d); | return trim($d); | ||
} | } | ||
</ | </source> |
Revision as of 15:06, 11 June 2013
Windows Safe directory name
function safename($d){
$d = preg_replace('|[\/\?<>\\\\:*\|"\(\)]|i', ' ', $d);
$d = preg_replace('/\s+/', ' ', $d);
return trim($d);
}