Hi,
so i’ve got a function to check beach water quality status and i was previously echoing out from the function which appears to be bad practice so i’ve switched to returning an array with the information.
My question is whether it is correct to output the below in the way i have done it.
> //let put this in an array
> $warning_array['abnormal'] = '<div id="abnormal">';
> $warning_array['abnormal'] .= '<div id="ab_start">';
> $warning_array['abnormal'] .= 'Abnormal situation '.date('d M Y h:i', strtotime($ab_date_start)).' <a href="#waterquality">(i)</a>';
> $warning_array['abnormal'] .= '</div>';
> $warning_array['abnormal'] .= '<div id="ab_desc">';
> $warning_array['abnormal'] .= $resultab[0]->item->comment;
> $warning_array['abnormal'] .= '</div>';
>
> $warning_array['abnormal'] .= '</div>';
Is this correct or should i only be returning the comment and date as different array variables and building the <div>
structures and classes on the page i want to output to?
thanks