Hey guys.. I have a foreach loop (with multiple variables inside of it) and I need to collect the variables, as well as other content, and store it into a single string so I can output it into an email. Has anyone done something similar to this before?

Here's some sudo code for what I'm trying to accomplish.. or something similar anyway.. ideas?

$body = "

echo $_POST['email']."<br />";
echo $_POST['percent']."%<br />";
$answers = $_POST['answers'];
$userans = $_POST['userans'];
$results = $_POST['results'];

foreach($_POST['questions'] as $i => $questions){
	echo $questions."<br />";
	echo $answers[$i];
	echo $results[$i];
}

";

Nevermind.. I figured something out. Thanks anyway.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.