The clean way is to use heredoc syntax, and modify your code like below to use only variable in the middle of html (no function call)
$color='#DADDE2';
$business=getbussinesspagination(0,$start,$per_page);
if ($business){
while ($row = $business->fetch_assoc ()){
if($color=='#DADDE2')
$color='#F9F9F9';
else
$color='#DADDE2';
}
else
{
}
$msg=<<
Name |
CITY |
ABCDEF |
BUDGET |
MEMBERSHIP |
UNTIL |
$business
MYHTML;
Alternatively, you can also use ob_start();
and ob_get_content();
to redirect the output into a variable you will use later.
ob_start();
// do all your code, nothing will be sent to screeen
echo '