fork download
  1. <?php
  2.  
  3. $file = '<b>some-text</b><a href="http://site-link">some-text</a>';
  4. $file = preg_replace('/(\>[^\-\<]*)-([^\<]*\<)/i', '$1 - $2', $file);
  5. var_dump($file);
  6.  
  7. ?>
Success #stdin #stdout 0.02s 13112KB
stdin
Standard input is empty
stdout
string(60) "<b>some - text</b><a href="http://site-link">some - text</a>"