Skip to content

PHP code snippet – How to assign value of a js variable to a variable?

<script type="text/javascript">
var abc= 'this is text';
<?php $abc = "<script>document.write(abc)</script>"?>   
</script>
<?php echo $abc;?>
See also  Python code snippet - How to remove first letter of a string ?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.