I have declared a javascript variable ,
var myJavascriptVar = 12345;
And unable to assign that value to php variable;>
Javascript will be interpreted in Client's browser and you can not assign it to PHP variable which is interpreted on SERVER .
Feasible Solution : You can submit the Javascript value via ajax or through form submit.