Guest User

Untitled

a guest
May 27th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. <?php
  2.  
  3. protected static function _filter($string, $user)
  4. {
  5. while (preg_match('/\[user:(\w+)\]/', $string, $match)) {
  6. str_replace('[user:'.$match[1].']', $user->$match[1], $string);
  7. }
  8. while (preg_match('/\[company:(\w+)\]/', $string, $match)) {
  9. str_replace('[company:'.$match[1].']', $user->Company->$match[1], $string);
  10. }
  11. return $string;
  12. )
Add Comment
Please, Sign In to add comment