I have one array that has values of arr1 = [1,2,3] and what I want to do is that 1,2,3 will store to another array with single index just like this arr 2 = [123] because this arr 2 will the one that I will store to the database.
my code is this
if($bul == "true"){
while ($ai < count($sentencearr)){
for($i = 0; $i<count($alpha); $i++){
if($sentencearr[$ai] == $alpha[$i]){
$answer[$ai] = $choicearray[$i];
$ia = count($alpha) + 1;
}else if($sentencearr[$ai] == $alphaup[$i]){
$answer[$ai] = $choicearrayup[$i];
$ia = count($alpha)+1;
}
}
$insert_arry = join($answer[$ai]);
$sql = "insert into message(msg, name) values ('$insert_arry[$ai]', '$name')";
$result=$conn->query($sql);
header("Location:home.php");
$ai++;
}
$arr2[] = implode()is close enough to make it duplicate