php - Getting Parse Error While Using Two Functions -


i trying write program using call reference calculate area getting parse error :-

parse error: syntax error, unexpected 'ar' (t_string) in c:\xampp\htdocs\workspace.php on line 7

now i, cannot think why happening?

<?php function perimeter(&$l,&$b,&$result) {  $result=2*($l+$b); }  funtction ar(&$le,&$br,&$result1) { $result1=$le*$br; } $result=1; $length=$_get['length']; $breadth=$_get['breadth']; echo "<h1><center>area , perimeter calculator using call reference</h1></center>"; $result = perimeter($length,$breadth,$result); echo "<br />the perimeter of rectangle <strong>$result</strong>"; $result= ar($length,$breadth,$result); echo "<br /><br />the area of rectangle = <strong>$result</strong>"; ?> 

you misspelled function:

  funtction ar(&$le,&$br,&$result1)   {    $result1=$le*$br;   } 

should be

  function ar(&$le,&$br,&$result1)   {    $result1=$le*$br;   } 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -