I want to put a comma in between the numbers I pull out of the database , but when I do it , it sometimes put the comma at the end and beginning which I don’t like
I want the numbers to be = 44123123123,44188123123,44123123123
Not = , 44123123123,44188123123,44123123123 Or = 44123123123,44188123123,44123123123,
I have tried everything but no luck . please help see also Bellow is what I have tried
$comma =",";
while($record = $targe1->fetch(PDO::FETCH_ASSOC)){
$cell = $record['cell'] ;
$company = $record['company'];
$surname = $record['surname'];
$final_cell1 = explode(",",$record['cell']);
$final_cell = implode(",",$final_cell1).$comma;
echo $final_cell;
}
I am writing a script which sends sms it pulls out numbers and names then it sends . the bulk sms plug in for sending many sms at once , it requires the numbers to be separated by a comma and if there is a comma at the begging or end it ignores and no sms will be sent . any help will be appreciated .