Re: [PHP][Tutorial]Functions
It looks good.
Quote:
Originally Posted by
Dj.flames
This was not even helpfull.
could have made it noob friendly,
i already know this i will be making a better tutorial with screenies on what it turns out to be,
and how to make a program
Something's telling me you don't know shit about what you're talking about.
Re: [PHP][Tutorial]Functions
yeaa preet easyyy :P:P:P
nice tut still
Re: [PHP][Tutorial]Functions
Quote:
Originally Posted by
Dj.flames
What Makes You Think That Nub im Pro PHP I bet You Dont Even Know What PHP Stands For,
Dont Mess With The Best,
When You Chill With The Rest (Noob Rests Ahahah)
The fact you capitalize everything.
Oh here come some 1337 skillz.
"i knoewz wat php iz!!!!1111!!!One"
I've never used custom functions, so this helped me quite a bit.
Thanks.
Re: [PHP][Tutorial]Functions
Anyone who is knowledgeable in an area doesn't act like a bloody twat. Be humble, and thankful for what you do know... Just because YOU think it's easy and not helpful at all doesn't mean that it won't help a newbie. Also, stop using 'nub' and 'Pro.' First of all, I doubt you can tell me the difference between newb and noob without looking it up, secondly, that nub crap is stupid gaylo idiot talk, and third of all, this is a forum where 'programmers' support each other. 'Coders' are welcome, but if you can't teach it, then shut the hell up.
Back to the topic, well done mate. Although, next time, try and include a small php web page to show them what their results would be., you know, like using the input methods to change background color, as well as displaying text. You could even show them basic input boxes, or something similar, and show them how they can use that to trigger and manipulate the method to do on the fly transformations. I'm not as good at PHP as I should, but the function is similar to the way I'd do it in java
PHP Code:
private final void setPageProperties (java.awt.Color color, String name) {
pageBackground = color; // main color of page
titleBarName = name; // sets title to "My web page, by " + name
updatePage(); // updates and refreshes content to reflect these changes
}
That is, assuming that I'm using a small webserver in java :3
Re: [PHP][Tutorial]Functions
Actualy this tut is stupid.
1) Take vars out of quotes.
2) Do not echo in a function.
3) Use tabbing
You haven't told about Public, private and abstract functions. This is just beginner PHP...
Re: [PHP][Tutorial]Functions
Quote:
Originally Posted by
Guildjuhh
Actualy this tut is stupid.
You haven't told about Public, private and abstract functions. This is just beginner PHP...
I think this can actually be quite helpful for those who never before even thought of using functions. Not that it teaches much anything, but as an eye-opener.
Re: [PHP][Tutorial]Functions
Quote:
Originally Posted by
Negata
I think this can actually be quite helpful for those who never before even thought of using functions. Not that it teaches much anything, but as an eye-opener.
True, but it's not worthy to call a tutorial...
Re: [PHP][Tutorial]Functions
Quote:
Originally Posted by
Guildjuhh
True, but it's not worthy to call a tutorial...
That's true.
Re: [PHP][Tutorial]Functions
Any tutorial is worthy, as not everyone is not an elite coder like you. I don't see why you guys oppose simple tutorials, questions etc, when you once didn't know how to do the same thing. But now that you do, you act like everyone who does not know how to do it is no worthy of knowing. Which is quite selfish of you, regardless how you found out, you should be open to helping those who don't know as much as you, or simply allowing it, rather than opposing it. Anyways, great tutorial, and I'm sure that it'll help some of the not so elite coders we have here.
Re: [PHP][Tutorial]Functions
I don't want to be a total dick but please also teach standards properly;
PHP Code:
<?php
function func_Name($arg, $arg2)
{
if ($arg < $arg2)
{
return false;
}
}
?>
Indent with 4 spaces OR a "tab".
Re: [PHP][Tutorial]Functions
a tip if your going to make a if, foreach, for with only one line.. no need for braces
Re: [PHP][Tutorial]Functions
like this?
PHP Code:
<?php
function func_Name($arg, $arg2)
{
if ($arg < $arg2)
return false;
}
?>
Re: [PHP][Tutorial]Functions
Quote:
Originally Posted by
john_d
a tip if your going to make a if, foreach, for with only one line.. no need for braces
That's true. But I generally find that code harder to read. Of course it's entirely a personal matter, but I find braced code even for one-liners be more complete and clear. As long as you're consistent with your code-style :)
Re: [PHP][Tutorial]Functions
he means:
PHP Code:
<?php
if($hi==TRUE)
echo ' hello ' ;
else
echo 'hi';
?>