This is how it all started

Posted by on Sep 13, 2013 in Various | One Comment

In the following article I want to relate how I started in the programming and web development industry, how I learned to code and build websites from scratch.¬†Why did I write this you may ask? So I don’t forget. Time makes you forget things. My 28th birthday was close and I wanted to keep track […]

How to load and use SimplePie 1.3+ with CodeIgniter 2.1+

Posted by on Jun 18, 2013 in CodeIgniter | 2 Comments

The famous RSS parser, SimplePie, has changed a few rules in the last couple of versions. The previous methods used to install the library in CodeIgniter are now obsolete. Lets take a look at the new way to get it working in just 5 minutes.

How to automatically force a cache refresh on CSS and JavaScript files with PHP?

Posted by on Dec 30, 2012 in CSS, PHP | One Comment

There is your client, complaining that they can’t see the changes you just made to their website. You explain them that they need to delete their browser cache in order to properly visualize the modifications. They said they don’t know how, and this is when you lose your patience and decide for a more radical […]

Finding unique array combinations with PHP (permutations)

Posted by on Jun 23, 2011 in PHP | 4 Comments

I was developing a website where people would place horse bets and the system should be able to calculate all the possible permutations based on the user selection. That means: finding all the possible combinations in a two dimensional array. I found a couple of functions but none of them would keep the array keys […]

Exporting your MySQL table data with PHPExcel + CodeIgniter

Posted by on Mar 8, 2011 in CodeIgniter, PHP | 12 Comments

Most of the time my clients need to download data from their database tables. Exporting to CSV is a pain in the rear for users and it leads to confusion (you know the colon and semicolon stuff). Today, I decided to make a very small controller that is portable and efficient for exporting full MySQL […]

Facebook PHP SDK and CodeIgniter for basic user authentication

Posted by on Feb 24, 2011 in CodeIgniter, PHP | 206 Comments

With CodeIgniter 2, plugins are no longer an option. Usually you would just add the Facebook PHP SDK as a plugin and you were good to go, but now, you need to make a little modification to the SDK in order to use Facebook Connect on your CodeIgniter application. Lets start by explaining what is, […]

CodeIgniter 2.0 is out with cool features!

Posted by on Feb 13, 2011 in CodeIgniter | 4 Comments

I know its a bit late, CI 2.0 has been out since January 28th, 2011, but lets talk about it anyway and recapitulate some of the new features of this framework. The new stuff is great, and this time I believe it deserves a second look if you are not much into CI. Let me […]

Read Word documents with PHP (up to Word 2003)

Posted by on Feb 10, 2011 in PHP | 8 Comments

Reading Word documents with PHP on a Linux box can be a real pain. It requires DOM which is only available on the Windows platform. However, Unkwntech from Stack Overflow made quite a nice function to read Word documents and extract its information. It will only parse text content, but it is enough for most […]

Detect mobile browser/user agent with PHP (iPad, iPhone, Android, BlackBerry, WP7 and others)

Posted by on Feb 2, 2011 in PHP | 79 Comments

With all this load of smartphones and tablets, it is mandatory for us as developers to optimize our content as much as possible so everybody can see it, no matter what device they are using. This is why I wrote a small but powerful function to properly detect a wide range of mobile devices and […]

CodeIgniter 2.0 new FTP class “download” method

Posted by on Nov 25, 2010 in CodeIgniter, PHP | 3 Comments

I needed to download some files from a remote FTP server and the store them in my website. The usual way would be to download all the files to my computer and then upload them to my website. In CodeIgniter 1.7.2 you would have to do this, however, the new CodeIgniter 2.0 has a new […]

HTML Table Class on CodeIgniter 2.0

Posted by on Aug 31, 2010 in CodeIgniter, PHP | 3 Comments

CodeIgniter 2.0 is coming out soon, so lets start studying the changes done to the HTML Table Class in the dev-release. One of the most requested features was the ability to set tag attributes to individual cells. On CI 2.0 this is completely possible, however, since the documentation is not fully updated yet, I decided […]

Fixing UTF-8 encoding problems on MySQL queries with PHP

Posted by on Aug 24, 2010 in MySQL, PHP | 4 Comments

It happened to me a lot of times, I had my connection set to UTF-8, my database was UTF-8, even my tables and every single field, however, for some reason, the information I updated in phpMyAdmin wasn’t being displayed correctly on my website and the information edited on my website wasn’t being displayed correctly in […]

Twitter feed on your website with cURL and PHP

Posted by on Aug 15, 2010 in PHP | 3 Comments

Pulling code from here and there, I gathered enough information to create a small function that allow you to pull your Twitter feed and display it in your website. What you do is basically call the function and pass a couple parameters. The styling can be done with CSS.

Alternate row colors with PHP

Posted by on Aug 10, 2010 in PHP | 3 Comments

I know there are several ways to accomplish this, however, of all the ones I’ve tried, this is the shortest so far: So, if you make two classes, row1 and row2, each with a different background color, the result will be alternated row colors in whatever you’re doing. Very useful for long lists. Update: you […]

Create thumbnails on the fly with CodeIgniter

Posted by on Aug 9, 2010 in CodeIgniter, PHP | 9 Comments

Before explaining the solution, you should know creating thumbnails on the fly is server inefficient, eats a lot of resources and they should be generated as soon as the images are uploaded. However, there are some occasions when we absolutely need to generate thumbs on the fly. In this article we will learn how to […]