• Welcome to ForumKorner!
    Join today and become a part of the community.

PHP Tutorial [1]

Rdogg112

Onyx user!
Reputation
0
Hey , Welcome to this PHP Tutorial , #1

First off, to start a php script you have to have this:
PHP:
<?php
?>
OR
PHP:
<?
?>
That is just to tell the server that it is a PHP script :).
i like the first one better, Now that you know how to start a PHP script, we will get into simple functions..

1. How To print stuff onto the screen
to print out stuff onto the screen you can use
PHP:
echo "Text You Want To Print Here";
or
PHP:
print "Text You Want To Print Here";
that would output on the webpage, Text you want to print here..

now lets move on to variables, variables are useful for quicker coding, organizing , for example
PHP:
$variable = "This is";
$variable1 = " a Variable";
echo $variable . $variable1;
or
PHP:
$variable = "This is";
$variable1 = " a Variable";
echo "{$variable}{$variable1}";
or
PHP:
$variable = "This is";
$variable1 = $variable . " a Variable";
echo $variable1;
or
PHP:
$variable = "This is";
$variable1 = $variable . " a Variable";
echo "{$variable1}";

Well.. you get the idea, there millions of possible ways to do that, what that will output is "This is a Variable".

Thanks For Reading My PHP Tutorial #1 !
 

someguy123

New Member
Reputation
0
Don't forget about:
PHP:
$variable = "This is";
$variable. = "a variable";
echo $variable;
 

Rdogg112

Onyx user!
Reputation
0
someguy123 said:
Don't forget about:
PHP:
$variable = "This is";
$variable. = "a variable";
echo $variable;

well thanks for that, but as i said there is millions of ways to do it :)
 

Nom Nom

Member
Reputation
0
Well, you should have used comments. Some people won't understand that . means concatenation
 

ness

New Member
Reputation
0
Nom Nom said:
Well, you should have used comments. Some people won't understand that . means concatenation

Exactly. Comments are a vital part of programming, no matter what language. Also, you are failing at PHP because you said you are using functions. There are two reasons why this is wrong. For one, echo and print are keywords. Not functions. And second, you are delving into functions after learning to start a script? Without going through comments or how to set up PHP? So if you choose to deny my first fact, you will be owned by your failure at teaching.

Ruben; dont make tutorials when you hardly know PHP yourself. You always ask anthony and others for help, so stop, learn and then write.
 

Rdogg112

Onyx user!
Reputation
0
ness said:
Nom Nom said:
Well, you should have used comments. Some people won't understand that . means concatenation

Exactly. Comments are a vital part of programming, no matter what language. Also, you are failing at PHP because you said you are using functions. There are two reasons why this is wrong. For one, echo and print are keywords. Not functions. And second, you are delving into functions after learning to start a script? Without going through comments or how to set up PHP? So if you choose to deny my first fact, you will be owned by your failure at teaching.

Ruben; dont make tutorials when you hardly know PHP yourself. You always ask anthony and others for help, so stop, learn and then write.

1. i do know php myself you troll.
2.echo and print are functions too.
3. you are a troll.
4. ???
5. PROFIT!!!
 

Nom Nom

Member
Reputation
0
Um, no it's not a function.
I quote from php.net
echo() is not actually a function (it is a language construct), so you are not required to use parentheses with it.
 

ness

New Member
Reputation
0
Nom Nom said:
Um, no it's not a function.
I quote from php.net
echo() is not actually a function (it is a language construct), so you are not required to use parentheses with it.

Thankyou. Now i don't have to. And no ruben i am not a troll, but i am anonymous. I know Angel through disclosed means, i know you through disclosed means. You do not know enough PHP to try and teach.

And another quote from PHP.net:
Note: Because this is a language construct and not a function, it cannot be called using variable functions

It would seem that whenever somebody proves you right, you make up lies about that person. You also are epically failing at laying out your thread as well as grammar. Its hard to learn with bad English.
 

Rdogg112

Onyx user!
Reputation
0
ness said:
Nom Nom said:
Um, no it's not a function.
I quote from php.net
echo() is not actually a function (it is a language construct), so you are not required to use parentheses with it.

Thankyou. Now i don't have to. And no ruben i am not a troll, but i am anonymous. I know Angel through disclosed means, i know you through disclosed means. You do not know enough PHP to try and teach.

And another quote from PHP.net:
Note: Because this is a language construct and not a function, it cannot be called using variable functions

It would seem that whenever somebody proves you right, you make up lies about that person. You also are epically failing at laying out your thread as well as grammar. Its hard to learn with bad English.

>implying you're an anonymous.
but yeah, I admit I am wrong.
 

Nom Nom

Member
Reputation
0
TWiSTA said:
That's good that you admit you're wrong, But being wrong is alright. :)

I thought that said being wrong is right. x)

I was also surprised that he'd admit it.
 
Top