| View previous topic :: View next topic |
| Author |
Message |
O-RLY Expert Cheater
Reputation: 0
Joined: 10 Apr 2007 Posts: 170
|
Posted: Fri Jun 15, 2007 7:37 am Post subject: [help] very simple php question |
|
|
| Code: | <?
class Yoske{
function show(){
echo'i am fat!';
}
}
$oclass = new Yoske;
echo $oclass->show;
?> |
Can someone explain me this code? |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Fri Jun 15, 2007 7:41 am Post subject: |
|
|
Um, if your learning php, shouldn't the book or website tell you what each command does. _________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
O-RLY Expert Cheater
Reputation: 0
Joined: 10 Apr 2007 Posts: 170
|
Posted: Fri Jun 15, 2007 7:44 am Post subject: |
|
|
I know only this:
| Code: | <?
class Yoske{ \\opens new class, named Yoske
function show(){ \\what is it..?
echo'i am fat!'; \\printing i am fat!
}
}
$oclass = new Yoske; \\what is it?
echo $oclass->show; \\what is it?
?> |
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Fri Jun 15, 2007 7:46 am Post subject: |
|
|
Ok, well where did you get that code? _________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
O-RLY Expert Cheater
Reputation: 0
Joined: 10 Apr 2007 Posts: 170
|
Posted: Fri Jun 15, 2007 7:53 am Post subject: |
|
|
i've saw it on a site and i wanna learn what its doing..
are you going help me?
Last edited by O-RLY on Fri Jun 15, 2007 7:57 am; edited 1 time in total |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Fri Jun 15, 2007 7:56 am Post subject: |
|
|
I don't know php, go back to the site and it should explain it. _________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
O-RLY Expert Cheater
Reputation: 0
Joined: 10 Apr 2007 Posts: 170
|
Posted: Fri Jun 15, 2007 8:02 am Post subject: |
|
|
try google for me some explains for the commands I dont know =\
I already search for didn't found anything.. |
|
| Back to top |
|
 |
DeltaFlyer Grandmaster Cheater
Reputation: 0
Joined: 22 Jul 2006 Posts: 666
|
Posted: Fri Jun 15, 2007 8:05 am Post subject: |
|
|
| Code: |
<?
class Yoske{ //creates a class called Yoske
function show(){ //creates a function in the class Yoske called show
echo 'you are fat!'; //echos to the html you are fat!
} //ends the function show
} //ends the class Yoske
$oclass = new Yoske; //the script starts running here. It declares a new variable called oclass and assigns it a new instance of the Yoske class.
echo $oclass->show; //this calls the function show in the instance of the Yoske class. This will cause you are fat to be echoed to the html page.
?>
|
_________________
Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for? |
|
| Back to top |
|
 |
|