I have a little piece of code like this:
And it gives me something like:PHP Code:<?
$i="1";
while($i<=$n)
{
$nid = "nid$i";
$mark = "mark$i";
$valuearray[] = "('" . $eid . "','" . $$nid . "','" . $$mark . "'),";
$i++;
}
foreach ($valuearray as $value)
{
echo "$value";
}
?>
('SB5000','1','21'),('SB5000','2','22'),('SB5000','3','23'),('SB5000','4','24'),
Which is what I want. But how do I save that output string as a variable? So if I was to go "echo $newvalue;", it would give me the string as the foreach() did?






Bookmarks