Archive for the ‘PHP’ Category

LiveDocx: Create DOCX, DOC, RTF and PDF

6 comments

Just a quick post to share with you a service I found over the weekend.  The site is called LiveDocx, and with a free membership you get all the tools you need to be able to generate DOCX, DOC, RTF and PDF documents on the fly from templates!

Read the rest of this entry »

September 8th, 2009 at 9:25 am  

Posted in Discoveries, PHP

Creating XLS Files With PHP

no comments

For many years, whenever one of my web applications needed to output tabular data I’d rely on CSV format. This does the trick for most data, as Excel and most other spreadsheet programs will open CSV’s without a problem. What happens when you want to get a little fancier though? Maybe include some formatting on columns, or even embed images?

In that case CSV doesn’t cut it anymore.  I had to investigate some methods of generating a valid XLS file directly with PHP.

Read the rest of this entry »

July 26th, 2009 at 10:31 am  

Posted in Coding, PHP

Validate Dollar Amount with PHP

3 comments

It can be hard when conducting interviews for a web developer position to really know a candidates skill level.  Recently a company presented me with the following problem, which I thought stood head and shoulders above the usual multiple choice quizzes and simple logic problems I’ve been presented with.

In the language of your choice, write a function that accepts a string. The string is a dollar amount, which may start with a dollar sign, and may have commas in it. Output should be a number, or false if there are illegal characters in the string.

My first instinct was to look for a PHP built in that would do the above, but surprisingly enough, there was none!  So on to my solutions.

Read the rest of this entry »

July 14th, 2009 at 12:06 pm  

Posted in PHP

Fixing Scrambled Curl Output.

no comments

I ran across a website tonight that would give me scrambled output when I pulled it down with cURL.  Where I was expecting to see html content, I was instead getting what looked like a binary file.  (Try running ‘cat’ on a jpg and you’ll see what I mean).

What exactly was happening, and how did I fix it? 

Read the rest of this entry »

May 12th, 2009 at 10:04 pm  

Posted in Coding, PHP

Consuming a Google Reader Shared Items Page with SugarCRM

one comment

This evening I began evaluating a fresh install of SugarCRM 5.2.0a.  A feature that caught my interest was the ability to consume feeds via the RSS module.  Having various feeds available to me while working in a CRM would be great, so I decided to try it out.

The first URL I tried was the the ATOM feed of my Google Reader Shared Items page.  It didn’t work.

Read the rest of this entry »

March 2nd, 2009 at 11:03 pm  

Posted in PHP