I'm having a hard time json_encode
echo json_encode($autocomplete -> fetchAll(PDO :: FETCH_ASSOC));
I'm doing a select from the database so fine, but when it transfers the data to this echo from above, many characters appear that javascript is not accepting, such as transforming the output from above that is displayed as below
[{"user_name":"Roberto Monteiro"},{"user_name":"Dk Teclive"},{"user_name":"Fye Flourigh"}]
In the format below that is accepted by javascript
["Roberto Monteiro", "Dk Teclive", "Fye Flourigh"];
that is, how can I turn this on?
[{"user_name":"Roberto Monteiro"},{"user_name":"Dk Teclive"},{"user_name":"Fye Flourigh"}]
and leave in this format
["Roberto Monteiro", "Dk Teclive", "Fye Flourigh"];
Whether with php or javascript, if possible, both ways, grateful now.