if statement inside concatenation



PHP Snippet 1:

while($data = $result->fetch_object()) {
    if($data->verified) {
        $icon = '<i class="fa fa-check-circle"></i>';
    } else {
        $icon = '';
    }
    $content .= '

    <div class="caption animated fadeIn">
            <a href="profile/' . $data->username . '">'.$icon.'<img src="' . self::display_image(AVATARS_THUMBS_ROUTE . $data->avatar) . '" class="img-circle dashboard-avatar" alt="Avatar"/></a> <a href="profile/' . $data->username . '">' . $data->name . '</a><span>' . Messages::generate_emoticons(User::generate_links($data->content)) . '</span>
    </div>
    ';
}