Category PHP

PHP CLI PHP Path

Two in one day! These posts are mainly helping me remember things down the road. Like the Local host one. I have re-visited that post so freakin' often.

jQuery and Pasting from the clipboard

Ever needed away to detect when a user copies and pastes something into your web application? I ran into this scenario where people were coping and pasting from Microsoft Word and when I tried to export the information using PHPWord, it would corrupt. Now, most of the special MS Word characters I was able to figure out how to replace when I was running the export except bullet points. They were going to be the death of me. I came up with another solution before the export. What if I run a check to see if bullet points were pasted in a textarea??

PHP Multidimensional Array Sort

I can't take credit for this, but I wanted to share this quick PHP tip (and make sure I have it for later too of course). Ever run into a situation where you needed to alphabetize a multidimensional array by one of the inner values? Well I have and I found the solution based on a StackOverflow (PROGRAMMER'S BEST FRIEND) thread.

PHPWord – Round 2

This is a follow up to PHPWord I wrote a blog about I wrote last year. I've had to use it a couple different times since then. While this plugin is pretty powerful, there are a few kinks that need to be worked out--especially if you are exporting a lot of text that was put in by users. I have been known to say that sometimes developing is like being a psychic. You need to prep the site in how you feel like the users should put in the information. Sometimes I'm good at it. Sometimes I've failed. This time, I didn't think something through while programming a form.

JavaScript and Dates

As a programmer, sometimes I get very frustrated working with dates. Sometimes they can be a butt. In any language. I had a lot of issues with the PHP DateTime object, the Date object and mktime. They are all similar…

PHP Dates

PHP can be fickle at times. Especially with dates. I ran into a situation at work where I needed to figure out the end of the next payperiod and if that that date was on a week day, figure out…

Zipping up a file & adding a password

Hey all! I've been wanting to share this tip for awhile. It's going to be short though. Ever wanted to make a file a little more secure by adding a password? It's easy to do on a LINUX server. All it takes is one line of code.