fork(1) download
  1. <?php
  2.  
  3. $string = "Onun Mesajı";
  4. echo preg_replace("~\w+\s*$~u", '<span>$0</span>', $string);
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
Onun <span>Mesajı</span>