fork download
  1. <?php
  2.  
  3. $string = '{ad:http://w...content-available-to-author-only...l.com/id=?123456}';
  4.  
  5. $string = preg_replace('~\{ad:(.*?)\}~', '<a href="$1">Link Text</a>', $string);
  6.  
  7. print $string;
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
<a href="http://w...content-available-to-author-only...l.com/id=?123456">Link Text</a>