function getHeader($id){
// VARS
$print="";
// SQL TO GET THE ORDER
$mySQL=mysql_query("
SELECT * FROM `table`
");
// LOOP THE IDS
while($r=mysql_fetch_array($mySQL)){
$print .= '<p>'.$r["id"].'</p>';
}
return $print;
}
// MAIL FUNCTION
function mailToSend($Id){
$getHeader = getHeader($Id);
$html = <<<EOM
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
$getHeader;
</body>
</html>
EOM;
}
mailToSend(46088);
?>
My question relates to my previous question (http://stackoverflow.com/questions/13917256/php-why-cant-eom-contain-php-functions)
Given that $print
is looped and contains many rows. How can I ensure the return statement loops my data. I must use return
.