content; $matches = array(); if (preg_match_all('@\{\{symbol:([0-9]+)\}\}@', $content, $matches)) { foreach($matches[0] AS $idx=>$match) { if ($sf_user->isAuthenticated()) { $user_id = $sf_user->getAttribute('user')->id; $content = str_replace($match, "{$matches[1][$idx]}".str_repeat('0', 4-strlen($user_id)).$user_id."", $content); } else { $content = str_replace($match, "(pro získání variabilního symbolu se, prosím, zaregistrujte.)", $content); } } } ?>