note 92200 modified in function.preg-replace by danbrown
| From: | danbrown@php.net | Date: | Tue, 14 Jul 2009 13:24:28 +0000 |
| Subject: | note 92200 modified in function.preg-replace by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-158267@lists.php.net to get a copy of this message | ||
This works fine for windows, linux and mac, encoding cp1251
<?php
function valid_filename($str)
return preg_replace('/[^0-9a-zа-ÑÑÑÑ\`\~\!\@\#\$\%\^\*\(\)\;
\,\.\'\/\_\-]/i', ' ',$str);
}
?>
can be used html without htmlspetialchars()
--was--
This works fine for windows, linux and mac, encoding cp1251
function valid_filename($str)
return preg_replace
('/[^0-9a-zа-ÑÑÑÑ\`\~\!\@\#\$\%\^\*\(\)\; \,\.\'\/\_\-]/i', '
',$str);
}
can be used html without htmlspetialchars()
http://php.net/manual/en/function.preg-replace.php