Pew Pew Laser Blog

Code. Glass art. Games. Baking. Cats. From Seattle, Washington and various sundry satellite locations.

Blogs about php

PHP Current Year.

3.5.2013

Here's a quick PHP snippet which will get the current year (from the PHP server) and display it along with a copyright symbol.

$currYear = date("Y");
echo "© " . $currYear;

Now you can finally stop updating your website's footer every January.

Incoherent Ramblings.

7.12.2007

Yesterday was hot - too hot to think! Blech! When we were house hunting, the real estate agents told us that most Seattle houses didn't have air conditioning, since they were only needed 2 or 3 days out of the year anyway. Yesterday must have been one of those days. I hear my Hollywood homies have taken or will soon take an all day rafting trip. I'm ever so jealous. I can't wait to see the video, JRack!

At my current job, I mostly do client-side coding - X/HTML, CSS and JavaScript; which I do enjoy greatly. This week I've been working on a multi-page survey with tons of form fields and a PHP backend. After writing the HTML and the JavaScript, I needed to figure out a better way to pass submitted survey answers from one page to the next. The current method of 'data goes into a hidden form field and is submitted again' was just too inelegant to be suffered. Yesterday I was racking my brian for this solution. Hmmmmm... Passing data... Between different pages... Using PHP... What could it be...? Aha! It's sessions! Sometimes lunch really is the best answer. How embarrassing. Use it or lose it folks.

Practice Makes Perfect.

4.21.2007

It's really amazing how easy it is to forget something if you haven't practiced it in a while. Last week, I was working on a PHP function for work. For about 45 minutes I tried to figure out how to get the entire query string from a URL. Then I remembered that the query string WAS the entire $_GET array! D'oh! And last month, I kept trying to do subtract 7 days from a variable in JavaScript, when all I really needed to do was a little modulus arithmetic. I was embarrassed.

Skagit Valley Tulips If you head over to the pictures, you can see the tulip pictures I took last week.