Im using this
$new_file_name = preg_replace('([^a-zA-Z0-9_-])', '_', $file_name);
But sometimes Ill get a renamed file such as
my___name__45.jpg
is there a way to limit it to just 1 underscore?
so that it would be
my_name_45.jpg
I know there is a simple solution for this but im not thinking of it.