How To Sort A Multidimensional Array By One Element In PHP

I had a table’s worth of listings and had stored all the values in a multidimensional array in PHP. The problem was, I needed to sort the multidimensional array, but based on just one element. Here’s the easiest, fastest solution that I found from the array_multisort function page of PHP (thanks to zequez at gmail dot com!). Here’s his original solution taken from that page: $multiArray = Array( Array("id" => 1, "name" => "Defg"), Array("id" => 2, "name" => "Abcd"),

Continue Reading

How To Subtract 2 Count Values Using SQL Statements

If you’re developing an application that makes use of SQL statements, you may come across a time when you’ll require to count() values from a table. You may also come across a time when you’ll need to subtract a count() value from another. The good news is that you don’t have to retrieve both count() values separately and then subtract them in your application’s code – you can actually just use a single SQL to obtain this value, and this

Continue Reading

How To Fix The Problem Of Icons Disappearing in Your Mac’s Dock

Sometimes certain icons in your Mac dock will just disappear. For example, the Firefox icon might disappear and you’ll see a blank space with just the Firefox name instead of the icon. I’m not sure why this occurs, but it’s some form of corruption to the dock settings file, so you’ll need to reset it. To do so, just do this: Use Spotlight and look for terminal. Launch it, and run the following commands. rm ~/Library/Preferences/com.apple.dock.plist killall Dock There you

Continue Reading

How To Open All Mailto Links With GMail Automatically in Firefox

The great thing about Firefox is that it has a built-in option to set mailto links to open up in GMail. That means you don’t have to stick with Outlook or Thunderbird or any of the desktop programs. To change your mailto handler in Firefox, just go to Tools > Options > Applications tab, and then type “mailto” into the search box. Next, click on the drop-down menu and select Gmail. Now, any hyperlinked email address that you click in

Continue Reading

How To Fix The Problem Of Flash Always Crashing in Firefox

I love Firefox, but I hate how it works with Flash. Essentially, it doesn’t work and causes hair-pulling frustration. I tried looking around to see if any other people are facing the same problems, and it’s clear that I’m not alone in this situation. From the various posts online, it’s a problem that has plagued Firefox users since several versions ago, and up till now, the same issue persists. The problem with this is that it’s an issue with a

Continue Reading

Sliding Sidebar