Parse error with a simple function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
theOlster
Forum Newbie
Posts: 2
Joined: Tue Sep 19, 2006 7:49 am

Parse error with a simple function

Post by theOlster »

Hi, I'm very new to php programming and am having a few problems creating functions.
Example code:
<?php
funtion doHello($Name = "Paul") {
return "Hello $Name\n";
}
?>
results in:
Parse error: syntax error, unexpected T_STRING in /home/oliver/public_html/thesubstitutes/diary/php.php on line 2
But I can't see anthing I've missed - any ideas?

PHP version 5.1.4 on custom Linux install (Fedora 5)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

function.
User avatar
happy_tapper
Forum Newbie
Posts: 5
Joined: Mon Sep 18, 2006 5:51 am
Location: UK

Post by happy_tapper »

Hi
On line 2 of your code you are missing a 'C' in FUNCTION.
It could possibly be just a spelling mistake that is throwing up your error.
theOlster
Forum Newbie
Posts: 2
Joined: Tue Sep 19, 2006 7:49 am

Post by theOlster »

Ok... now I just feel dmub(?sp)!

Many thanks!
Post Reply