1👍
The php implode()
function accepts two parameters, and you’re trying to pass tree, so the current implode syntax will return the wrong format, try it like :
var label_array = [<?php echo "'".implode("','", $name_array)."'"; ?>];
Source:stackexchange.com