Where to start for the PHP noob

On the Habari development mailing list, Daniel Smith writes:

I am interested in learning PHP (object)/MYSQL programming in general, and Habari-specific in particular. As a php newbie, could anyone please point me to any resources, latest quality books, tutorials or whatever, that could help me to learn how this all works?

An excellent question, and something that we experienced PHP folks would all do well to answer to help bring more people in and teach better coding practices.

For beginning PHP and MySQL, I really like the Visual Quickstart series of books. They have clear chapter goals and are rife with examples. Combine the books on PHP, MySQL, and PHP and MySQL with a willingness to frequently search the online documentation for both tools, and you can accomplish pretty much anything you set yourself to. Obviously, these are not for seasoned code veterans, but I think they're just right for people just starting who don't want to be babied but instead want to learn real code....

more

Your Tag Clouds Are a Bit Hazy

On page 74 of Web Designer magazine #130 is an article on making tag clouds in PHP. I suppose you could do it their way, but a few little things left me puzzled about their implementation, and I thought I would give it a go myself.

I'm a big, big fan of associative arrays in PHP. Most people who know arrays know that they are variables that contain a set of elements indexed by numerically, but PHP can index arrays in two ways. An associative array allows you to use a string key to identify each element of the array, rather than a number. The strings have to be unique, but for the purposes of creating a tag cloud, this is perfect because we only want to list each element once.

Using an associative array for the tags makes a huge difference in the amount of work you need to do. Using some smarts in other areas can offer some improvement, too. Let's step through the process and document it a bit to see how it goes....

more

Create Thumbnail in PHP

I wanted to get some thumbnail creation code in PHP to use for a little project I was working on, and so I traipsed over to Google and asked for "php thumbnail". I took a peek at the first search result, snagged the code, inserted it in my test app, and went merrily on my way. And that will be the last time I trust Google to find me code.

There are many problems with the code that I got. It's not malicious, but it does many easy things wrong. And the one thing that it's supposed to do well - the thing for which Google found it - it doesn't do correctly.

I can't entirely blame the code author, because this particular bit of code is very commonly written incorrectly. But what's a guy to do when you just want a simple PHP function (as opposed to a whole class) that generates thumbnails? Well, it's about time someone did something about that. Here we go....

more
Page:  1