fork download
  1. <?php
  2.  
  3. $search = "/log\('(.*)'\);/";
  4. $text = "log('Valdeir');";
  5.  
  6. function myfunc($matches) {
  7. return "log(\"".sha1($matches[1])."\");";
  8. }
  9.  
  10. echo preg_replace_callback($search, "myfunc", $text) ;
Success #stdin #stdout 0.02s 23680KB
stdin
Standard input is empty
stdout
log("7a642c6e5de0ef7c0d8ed26c7466ba4c1bdb4a06");