Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

variable question

Status
Not open for further replies.

sanjdhiman

Programmer
Jan 15, 2003
189
GB
Hi there i have a small problem

I have the following for loop

for ($d=0; $d<count($propertyresults); $d++)
{
echo $propertyresults[$d];
}
This works fine

What i need it to do is to go into a variable like $mailcontent but with other things as well for example

$mailcontent = &quot;Customer Name&quot; . $First . &quot; &quot; . $Last .&quot;\n&quot;.
&quot;Properties found:&quot; . &quot;\n&quot;.
<<then all the results from the for loop above dumped here>>
&quot;\n&quot;;

Does anyone know how to best tackle this situation??

Thanks in advance

Sanj

Sorry going brain dead
 
Hi, Sanjdhiman,
can't you simply store in another variable the output of your FOR cycle:
for example:

$newvar=&quot;&quot;;
for ($d=0; $d<count($propertyresults); $d++)
{
$newvar = &quot;$newvar &quot;.&quot;$propertyresults[$d]&quot;
}

$mailcontent = &quot;Customer Name&quot; . $First . &quot; &quot; . $Last .&quot;\n&quot;.
&quot;Properties found:&quot; . &quot;\n&quot;.$newvar.&quot;\n&quot;;


Gaetano
 
hey that does make sense weill do that mate cheers
sanj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top