-------------php code ends here-------------
<script type="text/javascript">
var e = <?php echo $tweetText; ?>;
var f = twemoji.parse(e);
document.write(f);
</script>
-------------php code starts here-------------
If I put single quotes or double quotes before and after then it matches any ' or " inside the tweetText and doesn't let the string print to screen.