I'm sort of betting that I'm not understanding this.
Either you already know what the number is ... the variable $id as you've described ... and you do this ....
PHP Code:
// Insert Polls
$rString="[poll".$id."]";
$message = str_replace($rString, "<iframe width=\"100%\" src=\"blog-poll.php?pollid=$id\" scrolling=\"no\" id=\"the_iframe\" onLoad=\"calcHeight();\" height=\"1px\" frameborder=\"0\" ></iframe>", $message);
Or you don't know what number is in the string [poll1] ... in this case it's 1, but it could be any number.
Because you're using the variable called $id, I'm not really sure what your question really is.
.