| Welcome to zetaNetwork. We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as viewing zetaNetwork exclusive tutorials and articles, and access to our code snippets section. Registration is simple, fast, and completely free. Click Here To Register If you're already a member please log in to your account to access all of our features: |
| PHP Basics | |
|---|---|
| Tweet Topic Started: Apr 16 2011, 10:53 PM (15,877 Views) | |
| Flavius | Apr 16 2011, 10:53 PM Post #1 |
|
Awesome Cool Dude
![]()
|
PHP Basics Difficulty: Easy Time: 5 - 10mins PHP is far easier to learn as opposed to other languages. While it does require knowledge of HTML, it's easier to pick up than Javascript. People ask what it does, well simply put, PHP is the backend of a website. It does the work, while HTML, CSS, and Javascript are all the facade. To have a fully functional dynamic website, you need PHP. If the content is not your own, then you can simply do with Ajax. Star and Finish:
Let's do something: Here you can see the similarities between PHP and Javascript. In both cases the result would be the text "Hello World". The echo tag is used to output content in the browser. This can be used in a variety of ways to output variables, html, text or anything at all. As you can see, in this case I have used double quotation marks as opposed to single. There is no difference in doing this except when echoing variables. Something you will also find in PHP is that line-breaks will not break the code. While they are not echoed as line breaks, it allows for more structure when coding. Variables and Echoing: A variable is defined by the dollar sign in front of its name. It is used in different ways and affects echoing. It does this by changing the way quotation marks are used to define the string. Here is an example of the different quotations marks and how variables are echoed and used in each case. This stuffs everything over when you want to echo a variables. It needs to be learned one way and stuck to all the way throughout. The case you choose is dependent on the difficulty and the readability. Some coders will choose one over the other simply because they prefer it. I prefer to use single quotes as I'm used to double quotes for my HTML. This makes it easier for me and everything is in single quotation marks. Flavius | zetaNetwork Instructor If you have any questions feel free to PM me or leave the questions bellow. |
| Offline Profile | Quote ^ |
| Pro | Apr 16 2011, 10:56 PM Post #2 |
|
Underground Coding
![]()
|
Great introduction to PHP, repped
|
|
Pro | zetaNetwork Instructor & Admin I Coded Most Of The Smexy Stuff You See ![]() PM Me Any Questions Need live support? Click here. | |
| Offline Profile | Quote ^ |
| Quozzo | Apr 17 2011, 12:35 AM Post #3 |
![]()
Do not fear death for death does not fear you.
![]()
|
indeed, +rep |
| |
| Offline Profile | Quote ^ |
| Kitsueki | Apr 19 2011, 05:05 AM Post #4 |
![]() ![]()
|
Ohhh, so you can include the variable in double quotation marks, but you have to concatenate it with single. Didn't know that, awesome! |
| Offline Profile | Quote ^ |
| Flavius | Apr 19 2011, 05:56 AM Post #5 |
|
Awesome Cool Dude
![]()
|
Glad I could help.
|
| Offline Profile | Quote ^ |
| VoidPC | May 25 2011, 07:42 PM Post #6 |
Getting Into The Groove
|
1. If I wanted to to declare a variable I must use "$" instead of "var"? 2. document.write() is the same with echo() ? 3. Instead of " + variable + ", we do this? " . $variable . " |
| Offline Profile | Quote ^ |
| Pro | May 25 2011, 08:27 PM Post #7 |
|
Underground Coding
![]()
|
1. Yes 2. Yes, it is also the same as the print() function in PHP. 3. Yes |
|
Pro | zetaNetwork Instructor & Admin I Coded Most Of The Smexy Stuff You See ![]() PM Me Any Questions Need live support? Click here. | |
| Offline Profile | Quote ^ |
| Oracle | May 26 2011, 05:40 AM Post #8 |
|
Newbie
|
Why is there two printing stuff on the screen functions? |
![]() ![]() | |
| Offline Profile | Quote ^ |
| Pro | May 26 2011, 03:45 PM Post #9 |
|
Underground Coding
![]()
|
I made a tutorial just for you :3 http://s4.zetaboards.com/ZetaNetwork/topic/8727668/ Also, sorry, print ins't a function, it's a language construct. I was thinking about Java. |
|
Pro | zetaNetwork Instructor & Admin I Coded Most Of The Smexy Stuff You See ![]() PM Me Any Questions Need live support? Click here. | |
| Offline Profile | Quote ^ |
| Oracle | May 28 2011, 12:42 AM Post #10 |
|
Newbie
|
Thank you Pro! <3 |
![]() ![]() | |
| Offline Profile | Quote ^ |
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Tutorials · Next Topic » |

















2:34 PM Jul 11