how can I place PHP variable in a JavaScript variable which is in a string .In below example I am showing few lines where I call PHP variable in script. I put all the html in $dom and then echo the page .
$dom.= 'var loop="<? echo $loop_from_php; ?>"';
$dom.= 'var array="<? echo json_encode($winner_ids); ?>"';
echo $dom;