private function m_agent(&$src, Template $template) { while (Tag::setof($tag, $src, 'm:agent')) { $agent = $tag->in_param('param'); if ($agent == 'docomo' && Mobile::is_docomo() || $agent == 'au' && Mobile::is_au() || $agent == 'softbank' && Mobile::is_softbank()) { $src = str_replace($tag->plain(), $tag->value(), $src); } else { $src = str_replace($tag->plain(), '', $src); } } $src = $template->parse_vars($src); }