## Re: [JavaScript] Help -- PHP Problem

Expand Messages
• ... n E i to the k 0 i cant find the right symbol for that equation, sorry = 1 ^ k+2 ^ k+3 ^ k+ ...+ (n-1) ^ k+ n ^ k wich in your case: n=3 k=2 1 ^2+2 ^2+3
Message 1 of 2 , Dec 10, 2004
> I am a beginner of the PHP ,somebody can help me to solve the
>
> This is the PHP coding,if "n is 3" ,"k is 2".After calculation, the
> answer is 14 ! I don't understand why the answer is "14".
>
> <!-- Equation.php -->
> <html>
>
> <?php
> function calPower(\$n, \$k){
> \$result=1;
> for (\$x=1;\$x<=\$k;\$x++){
> \$result=\$result*\$n;
> }
> return \$result;
> } // calPower
>
> function calEquation(\$n, \$k){
> for (\$x=1;\$x<=\$n;\$x++){
> }
> } // calEquation
>
>
> ?>
>
> <body>
> <?php
> echo "<font size=\"5\" face=\"Courier\">You have entered
> \$thebase as n and \$thepower
> as k.</font><BR><BR>";
>
> echo "<font size=\"5\" face=\"Courier\">After calculation,
> the answer is " .calEquation(\$thebase, \$thepower) . " !</font>";
>
> ?>
> </body>
> </html>

n
E i to the k
0
i cant find the right symbol for that equation, sorry

=>
1 ^ k+2 ^ k+3 ^ k+ ...+ (n-1) ^ k+ n ^ k