-1
The result of the query will come out like this (It depends on what was saved in the bank):
$week = 1,2,3
I have the following function:
function verificar(valor) { //Verificar se valor de m está contido em $week
var m = 1;
var arrdias = ["<?php echo $week; ?>"];
function funcD(value) {
return value === m;
}
var arr = arrdias.some(funcD);
console.log(arr);
console.log(arrdias);
... continua se arr for TRUE ...
}
The console.log(arrdias) is coming out like this: ["1,3,5"], but I need him to leave like this: [1, 3, 5] to be able to compare with the var = m, other than the function console.log(Arr) will always give false.
To make it work, I need to convert the PHP result (mysql query) into a javascript array.
I thank anyone who can help me!
Aff... really... sorry! Thank you very much and may God enlighten you!
– Nouvo