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 intact. So, I came up with this idea after a few gray hairs.
Twitter is great and with it comes great ideas from everywhere. Today, I decided to try a new kind of poll that I really liked and will boost your Twitter mentions a lot. I am talking about Twitter Polls. If you don’t know what it is, keep reading, you will enjoy it.
Google started rolling the +1 button as an experimental version of Google Search. Today, the +1 button is available to everyone and this means that “you” as a webmaster can add the +1 button to your website and let people share on Google your content.
Good news for us developers. Twitter added a new “Follow” button so people can one-click and follow you without leaving your website. It even pops a couple of tweets and some information about your profile!
CodeIgniter lacks of an error handling class for custom errors. The Form Validation class is very nice for forms, the logs are pretty useful as well, but what happens when we need to handle our own errors?. Currently there is no official solution for this so I decided to take the matter in my own hands.
I present you the Error Validation Class.
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 tables to Excel 2003 using PHPExcel and CodeIgniter.
According to MeFeedia, from all the web videos around the net, 63% of them are HTML5 friendly. For those on iPad or iPhones, it believe this is a very good thing. Flash is a thing of the past for watching videos on your smartphone or personal computer, considering a year ago the percentage of HTML5 compatible videos was just about 10%.
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, how to get started and how to authenticate an user using the Facebook API.
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 thank in advance the guys of the CI team for their great work.
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 of the tasks we will be doing anyway.
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 redirect to an special content accordingly.
Yeah, it is a much discussed topic in every CI forum. I needed to set up a payment gateway and it was mandatory to receive the gateway response via $_GET, so I decided to do an investigation on the matter and this is what I came up with.
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 ‘download’ method that will make it real easy to transfer files between FTP servers.
YouTube has an API to do this, however, there is an easier way to pull the thumbnails of a specific video if you know its ID. You can use this trick in any of your applications and it is not language specific.