PHPTutor.info

PHPTutor.info - The Place to Start for PHP Programming

PHPTutor.info is the place to get started with PHP, the powerful open-source server side scripting language. For starters, we have prepared a totally syndicated tutorial section that lists recent PHP tutorials to keep you updated. You will also find useful PHP discussion links and recommended PHP scripts that have been downloaded by many PHP developers.

Our PHP Security section will focus on how to establish secure coding habits that will help minimize hacker exploits to your scripts.

What is PHP?

Some of you may wonder what PHP is, and what can it do for you. To explain simply, PHP stands for Hypertext Preprocessor. It is a server-side programming language that can be used to create applications from the most simple HTML website to extremely complex multi-platform implementations. Popular applications coded using PHP include Friendster and MyBlogLog. PHP is also the primary languages for many open-source applications such as PHPbb, PHP-Nuke and WordPress.

PHP News - Powered by PHPDeveloper.org

PHPdeveloper.org

  • /Dev/Hell Podcast: Episode 4: The Cool Kids Club

    The latest episode of the "/dev/hell" podcast has been released - Episode 4: "The Cool Kids Club".

    Our fourth episode is all ready for your listening pleasure. In this exciting episode we focus on "The Conference Experience" and discuss why programming conferences are so important to developers. Chris talks about why CodeMash was so awesome and the awesome talks full of awesomeness that he attended. Ed talks about his own experiences with speaking and attending conferences, complete with a total derail by Chris on why a certain conference rubbed him the wrong way. Oh yeah, you also find out our opinions on what constitutes a "well-written PHP application". I'm sure you will be surprised by our answers.

    You can either listen to this latest episode either via the in-page player or you can download the mp3 directly.

  • Project: Patchwork-UTF8 - UTF8 Support for PHP

    Nicolas Grekas has shared another tool that he's pulled out of his "Patchwork" framework to make it a stand-alone tool: the Patchwork-UTF8 helper that provides matching functions to those PHP already has for regular strings, but a little smarter to work with UTF8 correctly.

    The PatchworkUtf8 class implements the quasi complete set of string functions that need UTF-8 grapheme clusters awareness. These functions are all static methods of the PatchworkUtf8 class. The best way to use them is to add a use PatchworkUtf8 as u; at the beginning of your files, then when UTF-8 awareness is required, prefix by u:: when calling them.

    In the README for the tool he talks about the functions included in the current release that match PHP's string functions as well as some additional methods like "isUtf8", "bestFit" and "strtocasefold". It relies on the mbstring, iconv and intl extensions being installed, and if they aren't, it falls back to other functionality (list of those methods included).

  • Charles Sprayberry's Blog: Why you should use DI

    In this recent post from Charles Sprayberry he explains why using dependency injection (DI) in your application is a good idea and can help make things easier in the long run.

    Dependency Injection is just a fancy term for passing dependencies to the object needing them instead of letting the object create its own. Hopefully, you've watched this great Google Clean Code talk about dependency injection by Misko Hevery where he talks about why you should ask for things instead of looking for them. I'm gonna talk about some reasons to use DI beyond just those presented in the video.

    He breaks it up into a few different sections:

    • It helps in the battle against global state
    • It helps your design
    • It makes using the single responsibility principle easier
  • Mike Wallner's Blog: Dropping server load with HTTP caching

    Mike Wallner has shared a quick and easy HTTP caching technique in a new post to his blog today. The key is in using the PEAR HTTP_Header package.

    Ever watched youself browsing e.g. a web forum? Noticed that you viewed the same page several times? Well, this means extraordinary and useless load for your server if there's no caching mechanism implemented in the web application. Even if there is some file or db cache you can still improve performance with implementing some http cache.

    With a few simple lines of code using HTTP_Header, you can tell your scripts how long to set the "expires" header to on your requests. This increment (in seconds) is relayed to the browser to tell it when to next fetch the page and not reload from cache.

  • Ibuildings Blog: 2011: A Year in PHP

    On the Ibuildings blog today there's a year in review post (from Ben Longden, Rowan Merewood and Alistair Stead) looking back at 2011 and everything that happened in the world of PHP.

    2011 has flown by in a blur as we have been busy helping many new clients with large scale PHP projects - proof that PHP continues to gain traction with enterprise. [...] The ongoing financial climate only adds pressure for IT managers to cut costs and deliver more value from their existing infrastructure and therefore require enterprises to re-consider any prior aversion to open source and PHP. This is allowing our industry to consistently buck the trend of the markets and expand to support the increased demand.

    They list some of the changes in PHP itself, like the Release Candidates for PHP 5.4 and the 5.3 requirements of some frameworks, as well as some community-related changes: Facebook's Virtual PHP Machine (hhvm) and the number of PHP-related events in Europe and the UK. They mention some projects that become more prominent in 2011 including BDD testing, Platform as a Service products and the EBay acquisition of Magento.

    Also included in the post are a few predictions for 2012 including a possible merging of frameworks along similar strategies, the increased use of dependency injection containers and a serious look into caching in PHP applications.

  • Site News: Popular Posts for the Week of 01.27.2012
    Popular posts from PHPDeveloper.org for the past week:
  • PHPMaster.com: Bending XML to Your Will

    PHPMaster.com has a new tutorial posted today about "bending XML to your will" - working with XML data using the XML Parser and SimpleXML functionality already included with PHP.

    If you've ever worked with the Twitter or Facebook APIs, looked at RSS feeds from a website, or made use of some type of RPC calls, you've undoubtedly experienced working with XML. [...] Knowing how to process XML data is a crucial programming skill today, and thankfully, PHP offers multiple ways to read, filter, and even generate XML. In this article I'll explain what exactly XML is, in case you haven't had any experience with it yet, and then dive into a few ways you can use PHP to bend XML to your will.

    He introduces the concepts and syntax behind XML first for those not accustomed and quickly moves into the tools to parse it. First he looks at the XML Parser, an event-based parser, and SimpleXML, an easy way to access the contents of a well-formed XML document. Snippets of code are provided for each to show you how to put them into practice.

  • Wojciech Sznapka's Blog: Always use most latest versions for benchmarks

    In response to some criticism about his previous post with some framework benchmarks, Wojciech Sznapka has posted updated results using the latest versions of each framework.

    In my previous post Modern framework comparison I presented performance tests, which compared Ruby On Rails, Django and Symfony2. After recieving a feedback in comments I decided to run this benchmark one more time on my own laptop (instead of on my hosting). The reason was simple: enviroment was outdated.

    There were some overall performance increases were seen, but some statistics were higher - the "time per request" for all of them grew, some by quite a bit. He presents these benchmarks with a caveat, though:

    You should never choose framework based on benchmarks. Those shows them from one point of view, but there are plenty of other aspects, such as support, community, maturity, number of ready to use components.
  • Mike Purcell's Blog: Use PHPUnit without PEAR

    Mike Purcell has a new post to his blog showing a method he's followed to be able to use the popular PHPUnit unit testing software without having to go through the PEAR installer to get there.

    PHPUnit is a great tool to protect us developers from introducing new defects when adding new features or re-factoring code. However there is one HUGE downside to PHPUnit; it must be installed using PEAR. Personally, I don't like 'auto-installers', I'd prefer to know what exactly is happening behind the scenes with regards to which libraries are required and how they are being called. [...] After breaking down the PHPUnit source code, I realized it could be installed without going through PEAR, and without too much headache.

    He walks you through the directories you'll need to set up (test/vendor), the commands you'll need to get the latest version and unpack it, changes to set up some symlinks and updating the PHPUnit source to modify the autoloader, bootstrap and phpunit executable.

  • Francois Zaninotto's Blog: Node.js for PHP Programmers #1: Event-Driven Programming... and Pasta

    On his blog today Francois Zaninotto has a post that aims to introduce those with a PHP background to how Node.js works. In this first part of his series, he tries to explain the idea of event-driven programming - parallel processing of different parts of an application based on some action taken in the code.

    For a PHP developer, asynchronicity is the most puzzling aspect of the Node.js runtime. It's simply a new way to write programs. And once you pass the first learning steps, event-driven programming opens a world of possibilities PHP programmers would never dream of. I'll try to explain you how it works, but first, let's talk about pasta.

    In his "pasta" example, he shows how a typical PHP application would make a "Pan" object, call a "warm" action, "add olive oil", etc. All of this happens in sequence, though and takes 29 "minutes" to complete. To help things along, he implements an "EventLoop" class that handles tracking the timing and includes two methods to execute callbacks and delayed methods. He expands on this example with asynchronous objects and method calls to handle multiple things at once. He relates this to what Node.js offers - a built in event handling system, an included EventLoop object and native blocking I/O operations.

Recommended PHP Scripts

Simple Machine Forum (SMF)
Simple Machine Forum (SMF)

It is a free, professional grade software package that allows you to set up your own online community within minutes. Its powerful custom made template engine puts you in full control of the lay-out of your message board