Tag Archives: PHP101

PHP 101: PHP For the Absolute Beginner

January 21, 2014

48 Comments

p. This area is intended for everyone new to PHP. It opens with a series of informal, entertaining tutorials written by Vikram Vaswani, founder and CEO of Melonfire. These tutorials build on a previously-published 5-part series which has now been updated and extended to embrace PHP 5, making parts of it suitable for those of you who already have worked with PHP 4 in the past.

Continue reading...

PHP 101 (part 5): Rank and File

July 21, 2004

41 Comments

p. When you first started reading this series, I promised you that you’d have a whole lot of fun. If you’re the cynical type, you may be feeling that I didn’t keep my promise. After all, how much fun have you really had so far? All you’ve done is learn a bunch of theoretical rules, added and subtracted numbers from each other, learnt primitive decision-making and gone round and round in the circular funhouse of loops. Heck, if this wasn’t a PHP tutorial, it would be kindergarten…I hear you.

Continue reading...

PHP 101 (part 1): Down the Rabbit Hole

November 30, -0001

84 Comments

p. If you’re new to Web development, you could be forgiven for thinking that it consists of no more than a mass of acronyms, each one more indecipherable than the last. ASP, CGI, SOAP, XML, HTTP – the list seems never-ending, and the sheer volume of information on each of these can discourage the most avid programmer. But before you put on your running shoes and flee, there’s a little secret you should know. To put together a cutting-edge Web site, chock full of all the latest bells and whistles, there’s only one acronym you really need to know:

p. PHP

Continue reading...

PHP 101 (part 12): Bugging Out – Part 1

November 30, -0001

3 Comments

p. Even the best developers make mistakes sometimes. That’s why most programming languages – including PHP – come with built-in capabilities to catch errors and take remedial action. This action can be as simple as displaying an error message, or as complex as sending the site administrator an email with a complete stack trace.

p. To make it easier to do this, PHP comes with a full-featured error handling API that can be used to trap and resolve errors. In addition to deciding which types of errors a user sees, you can also replace the built-in error handling mechanism with your own custom (and usually more creative) functions. If you’re using PHP 5, you get a bonus: a spanking-new exception model, which lets you wrap your code in Java-like try-catch() blocks for more efficient error handling.

p. In this edition of PHP 101, I’m going to discuss all these things, giving you a crash course in how to add error-handling to your PHP application. Keep reading – this is pretty cool stuff!

Continue reading...

PHP 101 (part 2): Calling All Operators

November 30, -0001

56 Comments

p. In Part One of this series, I gave you a brief introduction to PHP, and how it fits into your Web application development environment. I also taught you the basics of PHP variables, and showed you how to add, multiply and concatenate them together.

Continue reading...

PHP 101 (part 13): The Trashman Cometh – Part 1

November 30, -0001

2 Comments

p. Maybe you’ve heard the term GIGO before.

p. If you haven’t, it stands for Garbage In, Garbage Out, and it’s a basic fact of computer programming: if you feed your program bad input, you’re almost certainly going to get bad output. And no matter which way you cut it, bad output is not a Good Thing for a programmer who wants to get noticed.

Continue reading...

PHP 101 (part 14): Going to the Polls – Part 1

November 30, -0001

7 Comments

In the course of this series, I’ve taken you on a tour of PHP, teaching you everything you need to know to get started with this extremely powerful toolkit. You’ve learned how to process arrays, write functions, construct objects, and throw exceptions. You’ve also learned how to read user input from forms, search databases, and use cookies and sessions to maintain state. You’re no longer the timid PHP newbie you used to be, but a bold and powerful PHP warrior, ready to take on anything the world (or your boss) throws at you…

Continue reading...

PHP 101 (part 3): Looping The Loop

November 30, -0001

41 Comments

p. If you’ve been paying attention, you remember that in Part Two I gave you a quick crash course in PHP’s basic control structures and operators. I also showed you how PHP can be used to process the data entered into a Web form. In this tutorial, I’m going to delve deeper into PHP’s operators and control structures, showing you two new operators, an alternative to the if-else() family of conditional statements, and some of PHP’s more interesting loops.

Continue reading...

PHP 101 (part 15): No News is Good News

November 30, -0001

6 Comments

p. After the workout I gave you last time, you’re probably either chomping at the bit to build another PHP application or you’ve decided to give up PHP programming and try growing cucumbers instead. If it’s the latter, you should stop reading right now, because I can guarantee you that this concluding installment of PHP 101 has absolutely nothing to teach you about vegetable farming.

Continue reading...

PHP 101 (part 4): The Food Factor

November 30, -0001

24 Comments

p. Having spent lots of time travelling around the outer landscape of PHP – learning all about control structures, operators and variables – you’re probably bored. You might even be thinking of dropping out right now, and instead spending your time more constructively (or so you think) in front of the idiot box. That would be a big mistake. And when I say big, I mean humongous.

Continue reading...