<?php
require_once 'includes/connection.php';
$data = "select * from contacts_tbl";
$query_posi = mysqli_query($con, $data);
while($row = mysqli_fetch_array($query_posi)){
echo $row['contact_number'];
}
?>
the result of that is 09277432079 09236677868
What result I want is {09277432079,10236677868}
>Solution :
I made a loop over your contacts array to demo the concept of visiting those data in a while loop and echoing contacts comma separated and wrapped in parenthesis:
$contacts = [
'09277432079',
'10236677868',
'10436674963',
];
$arrayLength = count($contacts);
$i = 0;
echo '{';
while ($i < $arrayLength)
{
echo $contacts[$i];
if($i < $arrayLength-1)
echo ',';
$i++;
}
echo '}';