fork download
  1. <?php
  2. $content = "{youtube}omg{/youtube}";
  3. $find = array();
  4. $replace = array();
  5.  
  6. $find[] = '{youtube((?!}).)*}';
  7. $replace[] = '[embed]http://w...content-available-to-author-only...e.com/watch?v=';
  8. $find[] = '{/youtube((?!}).)*}';
  9. $replace[] = '[/embed]';
  10.  
  11. foreach ( $find as $key => $value ) {
  12. $find[$key] = '/' . preg_quote($value) . '/';
  13. }
  14. echo preg_replace($find, $replace, $content);
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
Standard output is empty