Please explain..

Status
Not open for further replies.

Olly_

Active Member
Oct 21, 2011
142
37
Can someone please explain all the 'scopes' and what they do, the website i'm using at is using language which I have never heard of before, w3schools so could anyone tell me what they do? oh, and what 'function myTest()' does.
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
Can someone please explain all the 'scopes' and what they do, the website i'm using at is using language which I have never heard of before, w3schools so could anyone tell me what they do? oh, and what 'function myTest()' does.

'function myTest()' is just a made up function you typed up, or read from the tutorial, it'll have an action in-side it deeper in what you're reading, or once you have coded it.
 

RastaLulz

fight teh power
Staff member
May 3, 2010
3,934
3,933
myTest() executes what's within the myTest() function when called.

For example:
PHP:
<?php
 
function myTest() {
 
    echo 'Hello world.';
 
}

Now when you execute the function my calling it else where in the code, it will out put the following:

Code:
Hello world.

Example:
PHP:
<b><?php myTest(); ?></b>

That outputs:
Hello world.
 

brsy

nah mang
May 12, 2011
1,530
272
Yes, as long has you have parentheses and a semicolon an the end, just like RastaLulz did.

Also, if you are making a class, you would have to call the function, and require the class' file. The only difference is with a class, you have to do something like this:

$class->functionName();

where without a class, you don't need the variable, you can do:

functionName();

I hope I helped :)
 
Status
Not open for further replies.

Users who are viewing this thread

Top