Jump to content

replace underscores with hyphens in a string


ludo1960

Recommended Posts

Hi guys,

I need to transform a filename like one_test to one-test and just_another_test to just-another-test. I'm just getting started with PCRE and this is beyond my new found skills

$str = $const . 'function.' . $o . '.html' ;

need to check $o for filenames like one_file becomes one-file and just_another_file becomes just-another-file

Thanks in advance...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.