Re: $pieces = explode(",", $_POST["fieldtype1"]);
| From: | Curt Zirzow | Date: | Wed, 09 Nov 2005 05:22:20 +0000 |
| Subject: | Re: $pieces = explode(",", $_POST["fieldtype1"]); | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-225406@lists.php.net to get a copy of this message | ||
On Tue, Nov 08, 2005 at 12:00:06AM -0500, John Taylor-Johnston wrote:
> Hi,
> $pieces = explode(",", $_POST["fieldtype1"]);
>
> What is a way to echo each pieces[x] separately so I can echo them like
> this:
>
> while(x=0 to xMax)
> {
> $sql .= "
".$pieces[x]." \r\n";
> }
Well, explode() returns an array so you are looking for how to loop
through the array of $pieces, so something like:
foreach($pieces as $piece)
{
$sql .= "$piece\r\n";
}
Curt.
--