I have a string in javaScript.
<script type="text/javascript">
Var string='String to use';
</script>
Now i want to access text of string in php. How can i access it. Or use it.
You will have to make an ajax call if you don't want to reload the page else add it to a hidden form field and submit. I usually do it in jQuery like this-
$.ajax({
url:"demo_test.txt",
data:{
variable_name_in_php_script:variable_name_in_javascript
}
success:function(result){
//process result
}});
Not sure but this might be of help to you. I hope everything works out.
http://w3epic.com/how-to-pass-variable-from-php-to-javascript-javascript-to-php/
varshould be written in lowercase