fork(1) download
  1. <?php
  2.  
  3. $re = '/(<\?php.*?)\$lang\[([^]]*)]/';
  4. $str = "<?php echo \$lang['extension_not_allowed'] ?>";
  5. $subst = '$1\\$this->$lang($2)';
  6. $result = preg_replace($re, $subst, $str);
  7. print_r($result);
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
<?php echo $this->$lang('extension_not_allowed') ?>