I have written a function that grabs data from my db and build an output. Each line connected with ;
function myFunction($db, $userID, $ExpArea) {
if ($v1 = $db->get_results("SELECT * FROM t1"))
{
foreach ($v1 as $v2 ) {
echo stripslashes($v2 ->var)."; ";
}
}
}
Later I include this function into another loop on my page. However there's always that extra ; and I'm not sure how to get rid of it.
foreach ($myData as $key => $value) {
$ExpArea = $key;
ExperienceListSummary($db, $userID, $ExpArea);
}
My output looks something like:
asdas dasd; asdasdasd; asdasdasd; asdasdasd;
I need to get rid of the last ;
😕