0
as I transform an array of numbers into a single string in php?
In the code below the variable $result is the array of numbers, and I tried to convert it to a single string with the function implode(). But it doesn’t seem to work because php gives the message 'Notice: Array to string Conversion in..." (QUERY LINE
And in the database did not work persistence...
How to make this conversion?
//Result é o array de números. Preciso convertê-lo para uma String...
$resultado = implode($result);
mysqli_query($con,"INSERT INTO forum (codUsuario,titulo,mensagem) VALUES('$result','$titulo','$mensagem');");
Failed to pass by which delimiter the string must be joined.
$resultado = implode(',', $result);
– rray
Numbers must be concatenated without delimiters...
– Lucas Pletsch
For example, if I have an array = [1, 2, 3]; I want a string "123"
– Lucas Pletsch
Vc needs a delimiter, before saving in the bank can give str_replace to remove it
– rray