Fifteen Wonderfully Creative uses for PHP

15 Wonderfully Creative Uses for PHP

If you are familiar with the basics of PHP, then you’re probably wondering how you can use it to make your website more appealing. The possibilities are endless, and you can write your own PHP scripts or implement widely available scripts from around the web. Let’s get started with 15 creative uses for PHP for your website!


1. E-Commerce

E-commerce is one of the major uses for PHP. From a small business level to an enterprise level, businesses are always looking to create additional streams of revenue online. If you know how to integrate existing e-commerce solutions or build your own from scratch, this gives you a distinct advantage with your clients.

Advanced Coders

If you want to build your own shopping cart application, you can either code the entire application from scratch or implement a PHP framework. If you are an intermediate to advanced PHP coder, I personally recommend using a framework such as CodeIgniter or CakePHP. CakePHP has a bakery section with readily available source code for e-commerce applications. For instance, you can integrate Paypal with your site using ready-made scripts. CodeIgniter has a user guide and a few tutorials to get you up and running quickly. Both of these frameworks have extensive documentation on how to create web applications from the ground up; which one you use is really a matter of personal preference.

Beginners

If you are new to PHP, or you just know some basic PHP programming, I would suggest using an existing e-commerce solution. Some of the available options are:

While I understand that each of these solutions has its own quirks, it might be easier to spend a few days with the documentation or a tutorial than to learn PHP from the ground up. It really depends on how much time you are willing to invest in tackling e-commerce.


2. Project Management Tools

For both freelancers and web development firms alike, project management is an important aspect of your business. Your clients need a resource to be able to check the progress of the work and provide feedback. Ideally, with a good project management system in place, your clients will be thoroughly pleased with the end result.

There are several excellent web-based project management tools on the market today. If you can afford to use a subscription service, I would highly recommend Basecamp. Although Basecamp was written in Ruby on Rails, it is an excellent advertisement for effective, streamlined project management solutions. For those of us who do not necessarily need a subscription-based product, you can build your own!

Building your own project management tool from the ground up will require a bit of in-depth PHP and some Javascript knowledge. The most important aspects of the application are security, time-tracking, collaborative to-do lists, file sharing, a message board, and a live preview of the website – which could simply be a link to an index.html page. Of course, you can add to this list or remove features as you like. The takeaway point here is that you can learn a lot about PHP by creating this application and your customers will be happy to see their project take shape. Showing you how to get started on your own project management tool is beyond the scope of this article, but I hope I have given you a good basis to start generating ideas!


3. Graphical User Interface

For those of you who are up to the challenge, you can extend your PHP installation to create desktop applications. This one is a challenge because it requires some extensive knowledge of PHP and it might also be easier to create desktop applications in other programming languages. If PHP is your favorite programming language, then you can use some of these PHP extensions to get you started creating GUI applications.

  • PHP GTK – This extension is a popular open source that implements the GIMP toolkit
  • ZZEE PHP GUI – A paid solution that allows you to turn your PHP scripts into Windows applications

The main advantage of creating your own PHP GUI’s is that you will learn a great deal about the language itself!


4. Building an Online Community

Whether your website is about business, entertainment, or products and services, internet users need to feel connected to the product or message. For example, if you develop web applications, a forum where your customers can discuss issues might be a good idea. As a user, if I have a question and I need support right away, a hotline or an e-mail form is often insufficient. With an online community, your visitors can help solve each other’s product-related issues, and even answer technical questions. You still have to provide some level of after-sales support, but a community can effectively decrease your workload and provide useful feedback.

You can build your own PHP-driven online community, or choose from widely available scripts that you can implement into your website. Again, if you plan to build your own forum from scratch, I do recommend the use of a PHP Framework. CodeIgniter, for example, has classes and helpers to take care of the most routine tasks you can think of. Beyond that, you can use several different forum building tools. Some popular ones include:


5. Developing Facebook Applications

You can integrate Facebook with your website using PHP. If you have developed Facebook applications using another language or you would like to get started with PHP, the Facebook developer’s wiki can help you to get started. The developer’s wiki explains the Facebook PHP client library and provides detailed instructions on how to install and use the files included in the library. This is certainly worth a look if you are interested in programming for the Facebook platform. For Facebook users interested in the back-end of the platform, this would be a natural step.


6. Generating PDF Files

The PDF format is Adobe’s proprietary file type for document exchange. Using a library called PDFLib, you can generate PDF files with PHP. This library is already included with PHP5; to access it, you need to uncomment the appropriate lines in your PHP configuration file. An example of why creating PDF files might come in useful is, if you were building an online invoicing application and you wanted to output an HTML-generated invoice in PDF format. You can then send the invoice via e-mail or print a copy of it to your client.


7. Parsing XML Files

PHP allows you to parse XML files. Parsing XML is an important feature of PHP 5 because not all browsers can output the contents of an XML file; so you can create a parser in PHP to facilitate this process. Using XML is important for RSS feeds, and also for data storage and rendering data on different devices – for example, cell phones use an implementation of XML called WML (Wireless Markup Language). Working with XML files in PHP is similar to handling the opening, closing, and reading of a file. The steps involved are creating an XML parser, setting functions to handle your opening and closing XML tags, opening the file for reading, reading the file incrementally and then closing it.


8. Mailing Lists

You can write your own script to send e-mail newsletters to your client, or use a ready-made script. PHP mailing lists are an excellent way to keep your clients informed about your services and products, holidays, vacations, and general announcements. Anything your clients need to know can be included in your automated newsletter. The PHP online documentation explains PHP mailing functions in more detail. There are also scripts you can download and install on your website:


9. Image Processing and Generation

Using the GD library with PHP, you can do more than just output HTML to the browser! You can output images in different file types including jpeg, png, and gif. This feature of PHP is useful because it allows you to create thumbnail pictures, add watermarks, resize and crop images, and even create a photo gallery!

Image by “Cal Evans


10. Create Graphs and Charts

Do you need visual representations of numbers on your site? PHP can create graphs and charts too! Using Image_Graph, you can create up to fourteen different types of charts including pie charts, bar graphs, impulse, dot/scatter, step, candlestick, box & whisker, radar. This is incredibly useful for e-commerce websites or websites where you need to present graphical data in a concise manner. the Image_Graph website has more detail on how you can get started!


11. Content Management Systems

One of the most popular uses of PHP is creating or using Content Management System. A good CMS allows your clients to update their website and add content without any in-depth knowledge of HTML and CSS. A good Content Management System should be user friendly, extensible, produce clean URL‘s, and be search engine friendly among other things. There are several online resources you can use to assist you with coding your own CMS from scratch, or you can use one of the widely available free or commercial solutions listed below:


12. Create a PHP Photo Gallery

By simply using PHP’s file handling functions, you can create your own photo gallery! you begin by placing your photos in a single directory, you then use PHP’s exif function to get header information about the photo and output a thumbnail version of it. The process is as straightforward as it sounds and its also a great way to present your photos!


13. Create Dynamic Website Templates

Using PHP, you can make it easier to add pages and elements to your websites dynamically. You begin by creating the HTML page and splitting it into the header, main content, and footer sections. Add the .php extension to your subsequent pages and use server-side Includes for the header and footer for each new page. You can also have dynamic sidebars and top navigation sections. As a matter of fact, the more “templated” your site is, the easier it is to update the content.


14. Create WordPress Plugins

If you have done any work with WordPress, you will know that it is a highly flexible blogging system that you can use to do just about anything from e-commerce to content management. With that being said, if you know some PHP and you delve into the WordPress Codex, you have everything you need to begin plugin development. If you need novel ideas for creating plugins, they even have a section where users post their plugin ideas.

Watch a screencast that teaches how to build your first WordPress plugin.


15. Creating Flash

The use of Flash in websites is a contentious issue to say the least! But there is nothing wrong with having Flash elements in certain places on your website; PHP can help with this! To these files you would use the Ming library to create Flash files in .swf format. With this library, you can generate movies, text, and even animations in Flash!

You’ve just learned fifteen creative uses of PHP which you can use to improve your website or just have fun with – enjoy them all! Any I missed?

Tags: tips
Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • jenny

    building net.tutsplus?

    • http://www.marcofolio.net/ Marco

      This is WordPress CMS (Mentioned in #11)

  • Erik

    Which website do you show for the PHOTO GALLERY example ?

    • http://ramon.com.ua Ramon

      It’s modded WordPress skin. Don’t remember the name of it…

  • http://anjhero.me anjhero

    wonderful resource!!

  • http://rcthegreatblog.com Rahul Chowdhury

    Great Uses of PHP Mentioned here man, its awesome. And just for information, did you get the PHP Elephant(Blue) Image from Flickr?

  • Drazen

    Why is this posted in “Tutorials” ? This is not a tutorial, its just a nice to have overlook of things PHP can do but this list is extendable up to 100 and more examples….

    Are there coming up any good tutorials this days? The last week was very weak, just some interviews. The Plus-Section could be updated too.

    • http://laminbarrow.com Lamin Barrow

      About the “tutorial” thing i totally agreed with you.

      It is worth noting that Nettuts does not produce much of it’s own content. Writers voluntarily submit their articles and if they are accepted we’ll see them here.

      • http://www.fun.com Babycakes

        Just checking to see how threaded comments work here.

    • Mystery

      why don’t you make your own?

  • http://laranzjoe.blogspot.com/ lawrence77

    #11 and #14 are same?

    Wow beautiful uses of PHP!
    nowadays i love PHP! :)

  • Markus

    Still searching for the “creative” usages in the article. IMHO the article is realy pointless.

    Almost everything from the list could also be done in ASP.NET or JSP… Nothing PHP specific except the WordPress Plugins

    • Mystery

      Ya because you focused on a word in the title, you failed the article.

  • http://twitter.com/heziabrass Hezi

    you should defiantly check out http://www.devunity.com it rocks!

  • http://agentfusion.com Jason Barone

    Great article for reference. This encompasses the beautiful concept of “don’t reinvent the wheel”. There’s plenty available to use, or start with.

  • mecaniqueorange

    next tut : what you can do with a computer

  • http://www.eraxa.com Sirwan

    More scripts could have been mentioned under “community building”, none the less I just found out about PHP-GTK so this is a good article, more of these please.

  • http://www.dsaportfolio.com.br Diego SA

    Great! PHP always comes in handy! Thanks!

  • Joe

    Where did you get the blue PHP elephant?

  • http://ivanbernat.com Ivan

    Uhm, Shopify is Rails, Basecamp is Rails.

    Do you homework next time.

  • windock

    Yeah, shopify is from the Rails world, do not humble, plz.

  • http://www.kieru.com Robert

    Okay; so you’ve covered the things PHP can ‘do’; I guess it’s ability to create flash objects or desktop application GUIs is ‘creative’… but yeah, not quite getting this article.

    Considering how much of the article just links to other frameworks and simple-install PHP applications a better title might be “How to let someone else’s PHP do your work for you”.

    • Mystery

      A designer wouldn’t understand.

  • Chase

    I would see creative things that PHP can do more as creating an IRC bot, or creating a script to login to an account to automate a process. Those would be more creative than the typical things that most PHP people know.

  • Nate

    Robert beat me to it. Great job telling us what PHP is meant for. How bout making a kiddy-pool section on this site and throwing this post in it. Never knew you could make Flash files with PHP, but other than that this isn’t a post worthy of Nettuts.

  • http://www.mydevwares.com/ myDevWares

    Cm’on we all knew that PHP is for creating web applications. What was the point of this article?

    • Mat

      Couldn’t agree more!! “15 Wonderfully Creative Uses for PHP” … or just “15 Uses for PHP”… I was expecting somthing along the lines of embedding it into a sprinkler system so that food-dye could be inserted into the mix in a regulated way creating spasmodic LSD rainbows – the above is standard at best.

      Even in my example though, it would still be PHP used for what PHP is used for… ie, programming. I just don’t get the point of this. Love PHP, glad you do too… but you seem a little overly thrilled by it.

  • X-Man

    3. Graphical User Interface !

    PHP GTK is not as popular as you said, all Linux GTK products are written in C,C++ or python . PHP gtk is not standard or recommended gtk lib

  • Joao Aliano

    Nice that PHPList “made the list”… It’s a mighty tool.
    It would be nice to see MediaWiki.

    Seems like wikis are the underdogs of webdevelopment. =(

  • http://www.zacvineyard.com Zac

    Oh yeah. Thank you for mentioning open source CMS platforms. What about Typo3?

  • Anon

    Worthless post :/

    • Mystery

      Yes yours is.

  • Matthieu

    And what about Prestashop for the e-commerce platforms ? This CMS is just perfect for light online store.

  • Neil

    14 – Like .Net Master Pages

  • http://www.websheffield.com Ed Baxter

    Nice round up. Would love to know where I can get a PHP elephant from, in #9 :D

  • http://www.cafefrenzy.com cafefrenzy

    Don’t forget about http://www.buddypress.org for creating an online community. They just released version 1.0.

  • http://www.frankyaguilar.com Franky

    Nteresting on the flash tip. Hmmmmmm
    Im gonna consult my scientist on this one!

  • http://www.aytemir.com Tschai

    I for one did not know I could build Facebook apps with PHP…I should think of a million making app very fast!

    Thanks for the roundup…

  • http://niceone.filipruzicka.net Filip Ruzicka

    I totally want that PHP elephant :-D

    • http://www.wittistribune.com Witti

      me too :-)

    • Joe

      me tooooo

  • Julian

    Great article! This gave me many cool and useful ideas of projects I can use to improve my php skills and the number of projects in my portfolio at the same time.

    The title could have better though. Something along the lines of

    15 Exercises to build your PHP skills
    or
    15 Things to include in a php portfolio

    would have been a more appropriate title.

  • http://www.quizzpot.com crysfel

    Thanks for the links! i will try some of those tools.

    thanks again

  • Doug

    Didn’t really learn anything from this. “Wonderfully Creative?” I think not. If you think a CMS, Mailing List or a Forum program built in PHP is “Wonderfully Creative,” you don’t understand PHP. What was PHP developed for exactly? Lets see: everything that was listed.

    Come on Nettuts. You’ve been letting us down lately.

    • http://eyoosuf.blogspot.com Yoosuf

      i am agree with you

    • Joe

      I agree with you man

    • Mystery

      Maybe you don’t understand PHP.

      You are probably a designer like the rest of them who focus on the ‘creative’ argument. fail.

      • Doug

        Nope. Actually, I’ve been working with PHP for over a year. The term “Creative” is being used as, lets say, using a material to build a house. In this case, the materials are wood and bricks, something that’s been around forever.

  • fake

    wow, lame

  • chris

    I think for the e-commerce you have it backwards – recommending Magento to beginner PHP developers is most definitely not a good suggestion (It uses very advanced coding techniques including design patterns, advanced database structure and an advanced implementation of MVC / extensibility).

    Also, you didn’t mention Zend framework for frameworks, which I think is also a very important framework to at least be familiar with.

    I work almost 100% with open source solutions so I suppose I’m biased against writing code from scratch (like a complete e-commerce solution!)

    I hope PHP takes over the interwebs!

    <3 nettuts

  • http://eyoosuf.blogspot.com Yoosuf

    you missed the Pommo mailing list http://pommo.org/Main_Page

    its a good grab and round up. thumbs up for u

  • G.oD

    I don’t think Flash must in this list. Sorry bad english.

  • http://www.makadco.com Abuzar Shafaat

    Yeh, this is zen of php based web development.

  • mehdy

    Hi,
    I tihink you forgot online game industries with php. i know about 10 type of games fully wriiten in php like travian and others

  • http://www.isonge.cn isong

    Very goooood~

  • http://kailoon.com kailoon

    Oh … That’s my site logo…. You use it as your avatar?

    • http://looneydesigner.com Joel Reyes

      Hello Kailoon,

      I hope that is ok? I’m a fan of your work :)

    • Ez

      Um, you can’t just copy and paste someone else’s logo because you’re a fan of their work.

      It gives people the assumption that you actually did some hard work to produce it. I would expect an author for Envato to know better.

      @kalloon: i’d kick up some dust if that were my site logo that some random’s come along and stolen. That’s exactly what’s gone wrong with the web these days.

      @mystery: what the heck is your issue man? People PAY for these tuts in many cases and are well within their rights to point out the poor and aimless standard of posts like this. You obviously have little else to do with your time other than vehemently defending the post author. Run along and let the grown ups talk will ya now?

  • awake

    Yii PHP Framework in my personal favorite

  • http://kylebrothis.com/ Kyle Brothis

    PHP is a must learn tool for and developers or designers. cakePHP and zen cart are great framesworks to learn from as a beginner myself

    • Mystery

      I think Designers should stick to what they are good at, Designing,

      Designers should stay away from Code.

      I agree with frameworks for beginners though.

      • http://kylebrothis.com/ Kyle Brothis

        This is true, but with the demands of the web industry today I really think Code is a skill that can not only bring higher paid jobs, but more flexibility as a freelancer.

  • rmbwebs

    PDF is no longer a proprietary format as of 2008. Adobe released it as an open standard.

  • http://www.impressivewebs.com Louis

    PHP? Creative? Isn’t that a paradoxical phrase? :o)

    • http://www.webcoursesbangkok.com Carl – Web Courses Bangkok

      I would say not Louis because you can have very creative and even beautiful code.

    • Mystery

      are you jealous because programmers can be creative too?

      Photoshop users aren’t the only creative people around here.

  • http://www.webcoursesbangkok.com Carl – Web Courses Bangkok

    And forms, forms are a great use of PHP and something as simple as the mail(); function can really help your site.

    …oh yeah and Add Your Comment….perfect example of PHPtasticness

  • Rafi B.

    Magento for beginners? Nah. Magento is a monster application based on complex MVC, using Zend Framework and the Varien library. Must be a very smart programmer to play with it.

    • Mystery

      Any framework is for a beginner..

      “all too easy.”

  • http://www.visual-blade.com Daquan Wright

    A lot of posts I’ve seen on various sites flanked PHP for several things. I for one, think it’s a simple language that is extremely powerful. Well, of course it takes time to master as with any programming language since the basics count for taking it to the next level.

    As long as you program with security and comments in mind, it can work.

    Not to mention, mosts of the content management systems run on PHP and MySQL. I think that says something as far as what PHP is capable of.

  • http://andreloconte.com Achille

    I would personally recommend FluxBB rather than PunBB
    See http://fluxbb.org

    • Mystery

      I was disappointed it uses XHTML :(
      fail.

  • http://php.net Modesto

    Sorry, but this article is about nothing… You can add 100′s more, like you just have listed.

    If your beginning in PHP i would suggest you to not use anything and try to build yourself, other wise just stop learning PHP now.