fork(1) download
  1. <?php
  2. $exp = "%var first% and %var second%";
  3. $tmp = preg_replace_callback("#%(.*?)%#si", function($matches) {
  4. return "%" . strtoupper($matches[1]) . "%";
  5. },$exp);
  6. echo $tmp;
Success #stdin #stdout 0.02s 24192KB
stdin
Standard input is empty
stdout
%VAR FIRST% and %VAR SECOND%