“The program can’t start because php5ts.dll is missing from your computer” Error

I was trying to execute a PHP file via the command line on a windows machine and got the following error “the program can’t start because php5ts.dll is missing from your computer” Now executing PHP via the command line in Windows is different enough from Linux, I didn’t know what it needed. In Linux I would have install php-cli which should have come with all the dependancies. In Windows however, I fixed the issue by...

Read More

Removing extra spaces from within quotes of a string in PHP

Every once in a while, you may be building strings that include quoted material. The issue is that if you’re doing it programmatically, you may be doing something that quotes different parts of the string. The issue is, that if the field you’re pulling from doesn’t exist, you may leave yourself with extra spaces in your strings. See the example below. Table: A Columns: color,number,price,shape Row1: red,4,3.25,square Row2:...

Read More

ERROR: `phpize’ failed and make: *** [oauth.lo] Error 1

I recently tried to install oauth on Ubuntu and got two errors during the process. Unlike what is said, it was not the simple install from pecl. sudo pecl install oauth This should work, but it threw my first error ERROR: `phpize’ failed More searching revealed that the phpize script is found in the php5-dev package, and those who had the error installed that to make it work. sudo apt-get install php5-dev It got farther this time, but...

Read More

Hot to set an element’s CSS style using Javascript

Hot to set an element’s CSS style using Javascript

CSS is a great way to reduce the amount of markup that needs to be on a page. It also standardizes how your pages look and feel and should make it easier and quicker to add new content. But what happens if you have Javascript logic on your page and based off some user action, you want to change the appearance of an object? With Javascript, you can reference the object, then set the style equal to your desired new value. You can even change the...

Read More

Google +1 counter for list of URLs

Google +1 counter for list of URLs

It was recently pointed out that there doesn’t seem to be a tool around to gather a total for all the Google +1′s on a domain. There are tools to do individual lookups. Open Site Explorer will do this, and they’ll do the top 25 pages of a domain, but there’s nothing for all the little pages that may have gotten recommended. Therefore, I created this free tool to find the Google +1′s for a list of URLs. Simply...

Read More

Parse a CSV file line in PHP

Parse a CSV file line in PHP

PHP has great string manipulation tools for importing files like fgets() to get a single line or file() to dump the lines into an array right at import. Explode is a great function when you start dealing with the contents of the file. However, if you’re bringing in a standardized file, like a CSV, there are some issues with explode. For instance, a comma may be in a string in the middle of the field, so you can’t break it apart on...

Read More