You da man, Leif.

That did the trick.

Didn't try the output buffering idea.  I need to look into that area.

Thanks for illuminating things a bit............

--Noah

----- Original Message -----
From: "Leif K-Brooks" <[EMAIL PROTECTED]>
To: "CF High" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, March 03, 2003 5:01 PM
Subject: Re: [PHP] Populate var with function output string?


> Try adding each output string to a variable, then returning it, like:
>
> function return_string(count) {
>     $return = '';
>     for ($x = 0; $x < $count; $x++) {
>
>          $return.= "<option value=$x> Row $x</option>";
>
>     }
>     return $return;
>
> }
>
> If you can't do that for some reason, try using output buffering.
>  www.php.net/ob-start
>
> CF High wrote:
>
> >Hey all.
> >
> >Is it possible to populate a var with an output string generated by a
> >function? So:
> >
> >*******************************
> >function write_string(count) {
> >
> >    for ($x = 0; $x < $count; $x++) {
> >
> >         echo "<option value=$x> Row $x</option>";
> >
> >    }
> >
> >}
> >
> >$my_string = write_string(5);
> >
> >echo $my_string;
> >*******************************
> >
> >I need $count option elements stored in $my_string. How to make this
happen.
> >
> >Thanks for any ideas,
> >
> >--Noah
> >
> >
> >--
> >
> >
> >
> >
> >
> >
>
> --
> The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent of
the law.
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to