Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- protected static function _filter($string, $user)
- {
- while (preg_match('/\[user:(\w+)\]/', $string, $match)) {
- str_replace('[user:'.$match[1].']', $user->$match[1], $string);
- }
- while (preg_match('/\[company:(\w+)\]/', $string, $match)) {
- str_replace('[company:'.$match[1].']', $user->Company->$match[1], $string);
- }
- return $string;
- )
Add Comment
Please, Sign In to add comment