Created
September 23, 2019 09:37
-
-
Save linkdigitaluk/a4d13f5b7eb4552faf24a8b522149c16 to your computer and use it in GitHub Desktop.
[Console Log PHP Variable/Array] #WordPress #PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php function console($arr) { | |
<script type="text/javascript"> | |
var arr = <?php echo json_encode($arr); ?>; | |
console.log(arr); | |
</script> | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment