fork download
  1. <?php
  2.  
  3. $html = "[div_row_392]...text...[/div]";
  4. $result = preg_replace('%\[(.*?)_(.*?)_(.*?)\](.*?)\[/(.*?)\]%sim', '<$1 class="$2" id="$3">$4</$5>', $html);
  5. echo $html;
Success #stdin #stdout 0.02s 24144KB
stdin
Standard input is empty
stdout
[div_row_392]...text...[/div]