SunQuest
 
           Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old April 18th, 2003, 08:31 PM
benos benos is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 233 benos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Article Dicussion: Basic and Not so Basic "Function" Features Using PHP

If you have any questions or comments about this article please post them here.

This forum post relates to this article

Reply With Quote
  #2  
Old April 20th, 2003, 08:05 PM
dev dev is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 1 dev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to dev
Quote:
function helloWorld($yourWords="GoodBye") {
echo $yourWords;
return $returnValue;
}

What's $returnValue ? Nothing?

Quote:
$globalVariableHello = "Hello World";
$globalVariableGoodBye = "Good Bye"
function helloWorld() {
global $globalVariableHello; //global declaration
echo $globalVariableHello; // access global variable
echo $GLOBALS["globalVariableGoodBye"]; // access $GLOBALS array
}

missing semi-colon after $globalVariableGoodBye = "Good Bye". Also, global declarationof Hello is fine, but definition of GoodBye also must exist inside of the function.

Quote:
// Notice in this example only one parameter for user information called $userInfo, this is // because this variable is an array

the second // must be on its own line, or must be before "called"

Quote:
$theVar = "hello world"
$theVar = "good bye"

missing semicolon in both places, in both examples



Other than those few typos.. awesome article. The dynamic functions are nice and work the same way as dynamic variables

$name = "foo";
$$name = "bar";
echo $foo;

// output: bar

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > Article Dicussion: Basic and Not so Basic "Function" Features Using PHP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway