2016-03-24 6 views
1

私は自分のPHPプログラムで何らかの分割をしようとしています。以下 は私のコードです:PHPの結果がゼロになる

print("Historic Total: '$histoicTotal' Valid weeks: '$numValidWeeks'"); 

$historicAvg = $historicTotal/$numValidWeeks; 

print(($historicTotal)/($numValidWeeks)); 
print(30/1); 

$totalAvg = (($historicAvg + $avg)/2); 
print("Havg = '$historicAvg' + Avg '$avg' "); 
print($totalAvg); 

出力はHistoric Total: '30' Valid weeks: '1'030Havg = '0' + Avg '' 0

+1

あなたの '$ avg'変数は明らかに空です。 – Technoh

答えて

2

タイプミスがあります:$histoicTotalは、真ん中に "R" を欠けています。 2行目の変数名と比較:$historicTotal