Raivis.purins Posted February 12, 2009 Report Share Posted February 12, 2009 <html> <head></head> <body> <?php function ReturnSomething($First,$Second) { print "First is:".$First."<br>"; print "Second is:".$Second."<br>"; $RESULT=$First+$Second; return $Result; } $Value=$ReturnSomething(5,2); print $Value; ?> </body> </html> pēc grāmatas jābūt uz ekrāna izvadītam 7niekam, bet rezultātā saņemu šos te: Notice: Undefined variable: ReturnSomething in C:\wamp\www\index.php on line 12 Fatal error: Function name must be a string in C:\wamp\www\index.php on line 12 Link to comment Share on other sites More sharing options...
indoom Posted February 12, 2009 Report Share Posted February 12, 2009 pirms funkcijām neliek $ priekšā Link to comment Share on other sites More sharing options...
cucumber Posted February 12, 2009 Report Share Posted February 12, 2009 Ja pirms f-jas izsaukshanas butu $ReturnSomething = "ReturnSomething"; tad ari nostradatu. Link to comment Share on other sites More sharing options...
Raivis.purins Posted February 12, 2009 Author Report Share Posted February 12, 2009 pirms funkcijām neliek $ priekšā okey, es atradu savu drukas kļūdu, tikai tagad man atkal paliek neizkaidrots, tas, kāpēc viņš man neizdod saskaitīšanas rezultātu 7 bet gan: First is:5 Second is:2 Notice: Undefined variable: Result in C:\wamp\www\index.php on line 10 Link to comment Share on other sites More sharing options...
Raivis.purins Posted February 12, 2009 Author Report Share Posted February 12, 2009 okey, es atradu savu drukas kļūdu, tikai tagad man atkal paliek neizkaidrots, tas, kāpēc viņš man neizdod saskaitīšanas rezultātu 7 bet gan: First is:5 Second is:2 Notice: Undefined variable: Result in C:\wamp\www\index.php on line 10 <html> <head></head> <body> <?php function ReturnSomething($First,$Second) { print "First is:".$First."<br>"; print "Second is:".$Second."<br>"; $result=$First+$Second; return $result; } $Value=ReturnSomething(5,2); print $Value; ?> </body> </html> okey, mana neuzmanības kļūda kārtējo reizi, result biju ar capslocku uzrakstījis. Paldies, visiem , kas izteica savu viedokli, topiks slēgts. Link to comment Share on other sites More sharing options...
Recommended Posts