Beginners PHP Articles
October 2, 2016
I’ve been building web apps for over 20 yrs, and teaching PHP since 2006. In that time, I’ve boiled down all my teaching and coding experience to three powerful tips. These three simple things you can do, will make learning PHP development much easier for you:
- Take hand written notes as you learn. It’s one thing to watch a video, or read a book. It’s a whole different experience when you take notes as you are learning. The simple act of putting pen to paper, will tell your brain that the information is more important than normal.Because of this, your brain will put more effort into remembering what you are writing the notes about.
… The more senses you activate when learning or experiencing something, the more powerful the memory will be. So when watching a video while writing notes, you are activating sight, sound and touch. The touch comes from the contact of the pen in your hand. By activating the touch feeling, you are giving your brain that much more of an association to the information.
- Write code as soon as possible! There is nothing like doing it for real. When you write code, even when you are not sure what all the code means, you will see that your understanding of the code, will come much more quickly. So don’t be afraid to start writing code! For example, on day one of my popular web developer course, students write code…. And they will all tell you, how easy it was to learn PHP with me. A part that success comes from students writing code on day one.
- Be prepared to make lots of mistakes! PHP programming is an error-prone process. Even the best coders in the world are constantly making mistakes. That’s why you have Windows 10, and not just Windows. OK, new versions of apps come out for two reasons:
- To fix bugs. Bugs are mistakes in code written by professional programmers.
- To add new features.
Nonetheless, making errors and writing PHP code go hand-in-hand, so don’t let it bother you when you make them. You might not get something on Monday, but don’t worry, it will probably come to you by Wednesday. In the end, all that is important is that you learn. No one will care if it took you a little extra time.
Hope that helps,
February 15, 2015
There are soooooooo many choices out there these days when it comes to writing PHP code. Here are just a few popular apps:
- Sublime Text – uber-nerds love this one!
- Dreamweaver – yes, it has a code editor too.
And there are many others, and I am not including the PHP IDE’s out there!
A PHP IDE (by the way,) is short for ‘Integrated Development Environment’. It is a code editor on steroids. They are much more powerful than standard code editors but they are also harder to learn. These days (2015) PHPStorm seems to one of the best, if not the best.
… The guys who created PHPStorm, created my favorite IDE for Java – IntelliJ IDEA. My nerd-servants are telling me PHPStorm is amazing. But, when teaching beginners how to program in PHP (or any other language,) it is best to not expose them to the added complexity of learning a full blown IDE. They can be very complex.
Back to code editors – so which is best?
In a nutshell: If I were teaching PHP, I would use either Sublime Text or Notepad++ if I was on Windows. Sublime Text works on both Mac and Windows but the license is ambiguous: it is free to demo but at some point you are supposed to pay the $70 for it. Not sure when though? I heard of some users still demoing it after 2 years!
This is a consideration for schools in terms of licensing. On the other hand, Notepad++ is free but it is Windows only.
Textwrangler is a Mac only HTML, CSS code editor but I don’t see you could use it for PHP.
Creator of Studioweb.com
April 30, 2014
The following details the steps you need to take to become a web developer – this is a question I get all the time by the way … you are not alone!
#1. Learn to code. You need the skills before you can sell them! Today (2014-2015) you need to learn the following technologies in this order:
- HTML5 & CSS3
- Twitter Bootstrap
- SQL & MySQL
- Object Oriented PHP (OOP in PHP)
To be clear, you don’t need to master all these before you get to step #2, #3 and so on … But you do need to see these as the ultimate goal.
… In fact, you could quickly move into step #2 once you have a good understanding of CSS and HTML under your belt. As you learn more though, you will be able to take on more jobs (simply because of the greater variety of skills you will have) and raise your pay/salary as you become more valuable and more experienced.
If you want to read the rest, download the pdf.
I hope you find this useful.
April 14, 2014
I am a big advocate of PHP but you have to ask yourself, how important is the choice of programming language, given so many great apps are created with many different languages? Think about it:
- Twitter – created with Ruby
- Facebook – created with PHP
- LinkedIn – created with Java
I get deeper into this topic in this video blog:
February 13, 2014
Anyone who reads my stuff knows that if I am anything, I am practical. So when it comes to learning (and teaching) programming to someone new to the whole programming game, for several pragmatic reasons, I think PHP by far is the best language to begin with. Here are some of the reasons:
- It is easy to learn.
- It is the most popular web scripting language.
- It is fast to program with.
Now, you can watch me yap about this in video for about 5 minutes – enjoy!
May 20, 2013
Not strictly PHP but something that any web programmer might have to deal with from time to time: denial-of-service attack (DoS attack).
What is a DOS attack?
Some dirty nerd (or group of dirty rat bastard nerds) decide they want to make your site or your servers unusable or at least, much less usable. What they do is flood the server with request in attempt to overload the CPU, memory and bandwidth.
… It just happend to me here on the killersites.com/killerphp.com servers. Some jerk-store using a microsoft server out of Washington, started flooding our PHP based forum with request … millions a day in fact! We have a fairly new dedicated server with multi-core processors, so we did not go down, but the server did get noticeably slower.
How did I discover it?
Besides noticing the server was acting a little sluggish (kinda like me after a few beers,) I popped open the web stats and noticed a huge amount of traffic from one IP address – that isolated source of big traffic pretty much tells you what you need to know.
How do you fix it?
Well, a good firewall is supposed to catch these things and block them … it seems my firewall falls asleep on the job sometimes, so in this case, I had to manually go in and ban the IP address. Once banned, any request from that IP are just dropped. This is not a perfect solution since the nefarious nerds can then just switch IP’s to continue the attack … but it seems to have done the trick this time.
Check out the chart below, showing the KillerSites server traffic flow, before and after I blocked the attacker’s IP:
May 3, 2013
Hey guys. My name is Roberto and I have been a web developer for the past five years. I will be blogging about interesting things in the life of a developer
I have worked with a few different frameworks over the course of my development career (e.g. CodeIgniter, Laravel, Symfony) and have also tried/tested many others. I always felt that frameworks are these perfect libraries of code that will make my life easy, and generally, that has been the case.
But over the last few months, I realized that frameworks are not perfect. Not even close. And although they do make annoying things like form validation or URI routing super easy, it seems that the simplest things can become buggy or complex.
No framework is perfect
Case and point: I have been working on a pretty decent sized project using CodeIgniter (my 4th project using this framework). CodeIgniter seems to be everyones “first”. The first framework where beginner PHP developers learn important skills like OOP and MVC.
But as I said, things are not perfect.
I kept getting some weird behaviour with PHP sessions, specifically when logging in and out in IE (insert IE insult here). It took me a few hours to solve the issue, mainly by partly rewriting some third party session library. But I felt it was really weird that something as simple as PHP sessions was broken (I mean there aren’t even that many PHP sessions functions)
So whats the point…
I basically have two main points:
- Frameworks are not perfect libraries of code that will make developing a breeze. They definitely do help (without a doubt), but dont be surprised to find bugs that will take you more than a few hours to fix.
- Saying that, fixing these bugs actually helps you become a better developer. It gets you to get into the smaller details and overall you learn much more about developing in PHP
When developing somewhat complicated web apps, I think using a framework is almost a must. Choosing a framework on the other hand…thats for another day.
For more discussion, you can find me on twitter here
June 3, 2012
Once you have an understanding of basic PHP concepts, the best way to develop your skills further, is to actually start building PHP applications – things that actually do something!
Fortunately, the Web has matured much in the last decade, and we now know what types of applications people are typically looking for – things like:
– shopping carts.
– log-in systems.
– content management systems.
With that in mind, we’ve put together a package that teaches you how to build these things, while teaching you more advanced PHP.
What’s really cool, is that once you’ve completed the project courses, not only will you have learned a lot about creating REAL PHP applications, you will have these applications that you can then use in your own projects, or your client’s projects. Check it out:
PHP Projects – Learn PHP by Building PHP Applications
February 15, 2011
I’ve been getting a lot of emails lately that are kinda like this:
Stef, I want to learn how to create apps for iPhones, iPads and Android devices … can you teach me!
Well the good news is that I am looking into this now. The bad news is that I don’t have anything ready … yet. That said, I do have some useful information and strategies for people who want to jump on this bandwagon quickly and easily.
Listen up …
iOS is for iPhones and iPads
That means you need to learn objective C … if you want to have total control over the iOS device. More on that later.
Google’s Android – on phones and tablets.
That means you need to learn a subset of Java (basically stripped down Java) if you want to have total control of the devices.
About objective C and Java
I don’t know much about objective C (but I’ve heard things …) but I do know a lot about Java. In both cases, many junior level PHP programmers might have a hard time with these languages because they require a deeper understanding of OOP.
The solution: HTML 5 and CSS3
The great thing about mobile applications, is that we expect that most of the time, they will be connected to the Internet – we assume that the apps will interact online at some point if not all the time.
This opens up the possibility of moving some of the heavy lifting over to the server where PHP can take care of biz for you. This MAY minimize the need to have to go down to the core of the device, forcing you to use Java or Objective C … depending on the device of course.
In the meantime, you can use HTML 5’s nifty new ability for local storage (of files,) to handle the times when a smart-phone is NOT online. How often does that happen …?
January 29, 2011
I recently got an email asking how to create password protected pages .. in an easy fast way for a beginner to PHP. From the email:
I was wondering if there is some premade script and setup for database I can utilize to get this up faster and still proceed to educate myself.
As any experience PHP nerd knows, there are several approaches one could take. But since this guy is new to PHP and programming, I decided on something simple: