mmm, yes, you could use the totally insecure method of passing values via URL or the complex method of using a reg expression parser.
or, you could simply assign the javascript values to a hidden form field and post the page to the php script i.e.
<html>
<head>
<title>sumpage</title>
</head>
<script language="javascript">
function submit_vals()
{
var frm = document.form1;
var sumtotal=0;
sumtotal=2+2;
frm.jsvals.value = sumtotal;
frm.jsvals.submit();
}
</script>
<body>
<form name="form1" method="post" action="phpscript.php">
<input type="hidden" name="jsvals" value="">
<input type="button" name="postme" onclick="javascript:submit_vals();">
</form>
</body>
</html>
which then posts to a script called phpscript.php
<? //phpscript.php
echo "The answer is ".$jsvals;
?>
which should simply print "The answer is 4"
hope this helps.
az