RBJ: Featured Blogs Code

This PHP code simply retrieves data from a file and posts it up on a web page in proper HTML format.

And that’s all there is to that.

You can view the PHP script in action over here.

Basic Steps

1. Open a file.

2. Read the contents of the file into an array.

3. Get the array size.

4. Use a ‘for loop’ to read through the array.

5. We retrieve the data of each featured blog from the database table.

6. Within the loop we generate the HTML for each featured blog.

7. Finish up, and the database connection is closed.

The Code

Comments

comments

Carlos Rull

Carlos Rull is a musician living in the San Diego area. His interests include Yoga, Eastern Philosophy, Zen Buddhism, and Gardening. He plays drums, piano, and composes New Age & Ambient music, and his albums are available on iTunes and Amazon.com.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.