Hello everyone i got stuck in a scenario where i need to run a javascript function in php and get the output in php variable. Below is my code -
$test = '<script type="text/javascript">
var sproutencodeemailRot13String = "<n uers=\"znvygb:qneeva@npbegvagreangvbany.pbz\" gnetrg=\"_oynax\">qneeva@npbegvagreangvbany.pbz</n>";
var sproutencodeemailRot13 = sproutencodeemailRot13String.replace(/[a-zA-Z]/g, function(c){
return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);
});
alert(sproutencodeemailRot13);
</script>';
When i run above code i got the data in alert CLICK HERE FOR OUTPUT But when i removed the alert i am not getting any thing in the $test variable when i print this. Please tell me any one what i am doing wrong? I want to save this variable data in database.