public function str2href($str) { $str = preg_replace('/s(w+://)(S+)/', ' <a href="\1\2" target="_blank">\1\2</a>', $str); }