[ create a new paste ] login | about

Link: http://codepad.org/R5IJ0GVC    [ raw code | output | fork ]

PHP, pasted on May 17:
1
2
3
4
5
6
7
8
9
<?php

$file = 'abc9d8sd#@#*# dfsdfs';

echo preg_replace("/[^-_a-z0-9]+/i", "_", $file);

echo "\n\n";

echo preg_replace("/[^-\w]+/", "_", $file);


Output:
1
2
3
abc9d8sd_dfsdfs

abc9d8sd_dfsdfs


Create a new paste based on this one


Comments: