Skip to content

Instantly share code, notes, and snippets.

@ryumada
Created February 1, 2021 13:37
Show Gist options
  • Save ryumada/df3763af88416608bd86e272b723c275 to your computer and use it in GitHub Desktop.
Save ryumada/df3763af88416608bd86e272b723c275 to your computer and use it in GitHub Desktop.
print html native tag to javascript variable using php echo
let string = <?php echo "`" . trim(preg_replace('/\s\s+/', ' ', nl2br($summary_notes[$whoami]['text']))) . "`"; ?>;
console.log(string);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment