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

Posts Tagged ‘PHP’

Open Source Social Networking Server: Built on LAMP!

in Web by Akash Mehta


Social networking just keeps on growing. It seems every major public business wants a Facebook application, corporations are adding social features to their websites, and organisations are bringing social networking into their intranets. Previously, building your own social networking applications involved some serious engineering challenges. Thanks to Ringside Networks, that just got a lot easier, with an open source (LGPL) social networking server built entirely on LAMP.

(more…)





The ultimate PHP web development environment, part 2

in PHP by Akash Mehta


In part 1 of this series, I looked at the web browsers and (Windows) IDEs. Today I’m going to look at a local development server and its PHP configuration, as well as some of the IDEs/editors available for Linux, especially the cross-platform options.

(more…)





5 PEAR gems: free php scripts that will help you code quicker

in PHP by Akash Mehta


PEAR, the PHP Extension and Application Repository, contains hundreds of freely available packages that can be reused in your application. Packages usually come with various functionality within one or more classes, and the PEAR coding standards make sure packages follow the same general style for ease of implementation. Best of all; they’re all entirely open source, from MIT to GPL.

However, many of these packages are bloated, slow and full of specialised features that you may never want to use. Sifting through the repository is also a challenge; a basic category system is in place, but it’s hard to tell what you want when you don’t know what’s available. Here are some gems from the PEAR repository that you could really find useful.
(more…)





PHP Script execution time and maximum workaround

in PHP by Akash Mehta


Ever wondered how long your PHP scripts were taking to execute? Or maybe you’ve broken the maximum execution time limit on your server, as defined in your php.ini’s max_execution_time directive. Well, dealing with PHP script execution time is actually quite easy. In this mini tutorial, I’ll show you how to measure your PHP script execution time, include monitoring at different stages of the process, and work around your max execution time limit.
(more…)





7 websites that will make you a better PHP developer

in PHP by Akash Mehta


Developing in PHP isn’t a textbook science. There’s skill to it, and that skill comes from experience. Now, you could try your hand at every single PHP development challenge out there, or you could learn from the experiences of others, widely published on the web in blogs and developer portals. Here are seven websites you should visit frequently to become a better PHP developer.

(more…)





Extracting text from Word Documents via PHP and COM

in PHP by Akash Mehta


I was recently working on an enterprise project in which I needed to detect the text inside a Word Document. Now, I could have got rid of all the non-standard characters from the .doc file and hoped I got something reasonable at the end. I could have tried to run Word 2007 via command line to save the file as a .docx. Or I could just talk to any copy of MS Word via COM and have it do all the dirty work for me.

Naturally, I chose the latter. Here’s ten lines of code that do just that.

(more…)





The ultimate PHP web development environment, part 1

in PHP by Akash Mehta


UPDATE: Part 2 now available.

After you’ve been coding PHP for a while, you start to work out what the tools of the trade are, which applications can help you work more effectively, and essentially how to get things done. While developing, your environment is crucial: not having the right tools to do your job can be a serious impediment on productivity. In this new series, I’ll help you bring together the ultimate PHP web development environment.
(more…)





Give Your Visitors a Relative Time

in PHP by Akash Mehta


Toby Somerville recently blogged about giving visitors a rough time - instead of displaying exact timestamps, providing a rough written approximation of the time.

Toby suggested that we generally communicate in approximate times, but on the web we usually work with exact timestamps. His idea was that by displaying the time as you would describe it verbally, he could better communicate the time in a visitor-friendly way.

After reading his post, I understood the merits of the approach, but it struck me that a relative time might be a little more useful for many situations. For example, in a fast moving discussion, a short timestamp (e.g. 8:30 AM) as well as a verbal summary of how long ago the time was (e.g. “4 hours ago”, “20 minutes ago”) are most useful to the user. In fact, this is precisely what Gmail does:

Gmail timestamps

A common feature of Gmail’s timestamp system is approximation, similar to what Toby was getting at. For example, as you approach 60 minutes in the hour, Gmail seems to switch from “x minutes ago” to “1 hour ago”, even if you’re not quite there.

Now, I figured this could be achieved very easily in PHP - and it could. After the jump, here’s the code:

(more…)





PHP-GTK2 is out!

in PHP by Akash Mehta


A while back, I wrote an article on developing desktop applications in PHP, using PHP-GTK to demonstrate. At the time, I was using a beta build of the PHP-GTK extension. A few days ago, PHP-GTK 2 stable “leap day special” was released, and it’s now better than ever.

Check out the changelog; notable changes since v1 include greatly improved API coverage, support for GTK versions up to 2.12, clipboard support and some restructuring. Head over to the PHP-GTK download page and grab a copy from CVS; if you’re running Windows, try Gnope, a simple PHP-GTK installer for Windows.





Say hello to namespace naming conventions!

in PHP by Akash Mehta


First, we had variable naming conventions. Then we got classes and functions / methods, so we got general naming conventions. With PHP 5.3 introducing namespaces, it’s time to say hello to namespace naming conventions.

Namespaces were introduced to solve the problem of naming clashes. Once upon a time, all your code lived in one, two, maybe three files, and you could see and know exactly what was going on. Then applications started expanding, and OOP came along. Suddenly there were hundreds of functions, classes and methods in your application, not to mention variables and properties.

(more…)





Blog Categories Blog Archives