Helping ordinary people create extraordinary websites!
HOME TUTORIALS SCRIPTS WEB HOSTING BLOG FORUM
Get Our Newsletter
Your Email:
Blog Feed

PHP Blog

Easy Screen Scraping in PHP with the Simple HTML DOM Library

in PHP by Akash Mehta


Client-side developers always had it easy – libraries such as jQuery and Prototype make finding elements on the page reliable and efficient. In PHP, regular expressions tend to get rather messy, DOM calls can be confusing and verbose, and often the string functions just aren’t enough. In this tutorial, I’ll show you how to use the middle ground – the open source PHP Simple HTML DOM Parser library, which provides jQuery-grade awesomeness for easy screen scraping without messy regular expressions. (more…)





SimpleTest: Unit Testing for PHP

in PHP by Akash Mehta


We recently looked at front-end testing of web applications with Selenium. Today, we’ll take another approach to testing your PHP applications: backend unit testing for your actual PHP code. As part of our posts on test driven development, here’s a quick intro to using SimpleTest to test your PHP applications. (more…)





Load testing your web application with Apache Bench

in PHP by Akash Mehta


Often you need solid metrics on the performance of your web application. Benchmarking your website can provide insight into which sections of your application might need major optimizations, and helps in dealing with scalability issues. Apache Bench, or ‘ab’, is a command line load testing utility which ships with Apache, and allows you to simulate load on a web server. In this tutorial, I’ll show you how to get started with ab. (more…)





8 Cool Functions in the GD2 extension

in PHP by Akash Mehta


Most PHP developers have at least heard of GD2; thanks to its prolific use in CAPTCHA generation, the image functions in PHP are standard practice for many. But the extension’s uses don’t end there. After the fold, here are eight cool things you probably weren’t aware could be done with GD2, and might be useful for your web applications. (more…)





Phing: A build system for PHP

in PHP by Akash Mehta


As PHP applications grow in size and complexity of structure, developers often find themselves putting together a “deployment plan” – that is, a set of steps to go through each time they want to take the code and package, deploy or test it. This process could involve creating some deployment-specific configuration files, packaging up the code, storing the current state in version control, even setting up the database. Phing is a build system for PHP, based on Apache Ant, that aims to automate many of these processes and simplify application deployment for PHP developers. (more…)





WebGrind: web-based frontend for XDebug PHP profiling

in PHP by Akash Mehta


Webgrind is a web-based Xdebug profiling frontend for PHP similar to kcachegrind. Webgrind provides a simple PHP-powered interface for examining the output of XDebug’s profiling reports, for a quick and simply overview of the performance costs in various areas of your PHP application.
(more…)





Getting Started with ORM in PHP

in PHP by Akash Mehta


ORM, or Object Relational Mapping, is a database design approach that simplifies managing complex databases for programmers. Instead of direct database access, an ORM layer in a PHP framework can make “objects” stored in a database behave like actual objects from a programming perspective – for example, creating a new “car” stored in the database could involve a call to $car->new(). By abstracting actual database access, web development can be more productive and result in more reliable applications. Here’s a quick intro to ORM in PHP. (more…)





Benchmarking PHP frameworks

in PHP by Akash Mehta


Over on the AVNet Labs blog, Ekerete Akpan has posted a few results from his recent framework benchmarks to much controversy. His tests covered a few major PHP frameworks, such as CodeIgniter, CakePHP and Zend Framework, along with baseline results for serving static HTML and procedural PHP versions of the same page. He also covered some basic Ruby on Rails, including Passenger (mod_rails?) and Ruby Enterprise. Here are some of his more interesting findings. (more…)





Four CSS Tricks Every PHP / Web Developer Should Know

in PHP by Akash Mehta


It’s not easy being a web developer – in addition to a server-side language, we also have to learn a markup language, yet another (client-side) language and a presentation system. As a result, we tend to focus on what we’re closest to – the business logic – and neglect the front-end.

But you don’t have to be a web dev guru to build great applications: with just a few simple tricks, you can make your web based interfaces more usable and more visually appealing. Here are a few simple CSS tricks every PHP / web developer should know. (more…)





Debugging CakePHP applications in Zend Studio for Eclipse

in PHP by Akash Mehta


After I recently upgraded to Zend Studio for Eclipse, I noticed one troubling feature of my setup – I couldn’t debug applications with “pretty urls”. Zend Studio for Eclipse has a great debugging platform setup, even with a dedicated IDE layout for debugging, and the Zend Studio Debugger backend on the server is quite powerful in itself. In this tutorial, I’ll show you how to make use of that power and debug your Cake applications with Zend Studio for Eclipse. (more…)





Blog Categories Blog Archives
Ask A Question
characters left.