I placed a javascript inside a .php file
$script = "<script type='text/javascript'>
jQuery( document ).ready( function($) {
$(document).ready(function() {
$('#particles').particleground({
dotColor: '<?=json_encode($dotcolor)?>',
lineColor: '#5cb9bd',
});
});
}
);
</script>";
and tried to use <?=json_encode($dotcolor)?>
to echo a variable. But it isn't working.
Any idea what I'm doing wrong?