-1

Hi i'm begineer in PHP/JS and i have small question, how can PHP read values of variables in JavaScript?

i have this JS code where i have values

<script type="text/javascript">

function test(tag) 
{
var output = tag; 
<?php $tags ?> = output; //i tested, but not works
}
</script>

there's php read code

<?php
echo "$tags";
?>

i'm in end with this, Thanks for answers!

4

1 Answer 1

2
<?php $tags ?> = output; //i tested, but not works

should be

<?php echo $tags ?> = output;
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.