Wednesday, October 23, 2013

Day 17 & PHP

Today we started learning PHP. Well, some people have been on it for a few days now, but according to the class schedule and lectures--the 23rd is the official start date. I have done some PHP in my day and after watching the 5 hours of videos, I think I remember a lot of it. I The videos are kind of fun because the instructor does a good job in explaining what to do. The only problem is he is super fast at typing and hard to keep up with haha..

PHP is really composed of only a few things. They are: for loops, if/else statements, arrays, and some logic. If you can get these down, you can really do anything with programming. I have spent a lot of time with Python, so I think I just need to master the syntax and I should be alright.

To the right is an example of some of the PHP I wrote today.

Basically, this is setting the variable X to 1. The $ is required for all variables in PHP. Then we are adding 1+5 & 1+2--to get 9. You kind of work from right to left in programming. Next, you echo or print on the page, X is equal to: 9. (The periods are for concatenating or "gluing" the sentence or string together. The spaces in the quotes space out the sentence so it is not, X is equal to:9. The former looks a lot prettier, doesn't it?

You do the same thing for the next part. So, x will equal 110 because it is 10 * 10 plus 10. Which you then just put in the sentence below. Easy, right? Also, the <br /> tags are for putting breaks or spaces between lines on the page. Again, all about making it look prettier. (warning--no transition to the next paragraph)

I got some more help with Databases today, so I think I just need to do some more problems and I will have those down. I spent too long looking up easy (didn't know at the time they were easy) examples online, instead of practicing the problems the Coding Dojo had prepared.

Tons more PHP tomorrow, and I cant wait!

- Kyle

No comments:

Post a Comment