linein designs

Posts Tagged ‘php

Dave in Michigan contacted me and wanted to know if it was possible to take the script used from this previous post and only display the last X number of pictures uploaded to a directory. Something to note before you get started though. The script will read the entire directory so if you have a [...]

26 Feb, 2009

PHP Font Preview Function (text to image)

Posted by: john In: php|programing

For work we needed a way to allow the customer to preview what their Bible imprint text would look like before they placed their order. I’m sure there are ways to do this with JavaScript, but we chose to do this with PHP to prevent the site from relying on Javascript (there was already enough [...]

Tags:

I’m just finishing up a little project to improve the search ability on a website and I want to display an image and message say “loading…” until the script finished running. Below is an easy way to do that. UPDATE: Please view the updated way to do this that is a little more practical in [...]

Here’s the follow-up article on how to easily get file sizes nicely formated. Below is a quick function that will display the file size in KB, MB, or GB all easily accessed through a function. function formatbytes($file, $type) { switch($type){ case “KB”: $filesize = filesize($file) * .0009765625; // bytes to KB break; case “MB”: $filesize [...]

Tags:

04 Apr, 2008

Find Time Between Two Dates in PHP

Posted by: john In: php|programing

Below is a quick PHP function that allows you to find the time between two dates. The dates must be in seconds from Unix Epoch. if(!function_exists(timeBetween)) { function timeBetween($start_date,$end_date) { $diff = $end_date-$start_date; $seconds = 0; $hours = 0; $minutes = 0; if($diff % 86400 0) { $rest = ($diff % 86400); $days = ($diff [...]

Tags:


  • Seren: Thanks - google did not fail me in finding this snippet (after 2 hours of 'why isn't this working!' before I choose to look for answers. That select
  • zdenis: type your scp command with nohup at the beginning: >nohup scp... enter your password stop temporarily the command with CTRL+z put on b
  • Criz: php script >> How to get the number of hours and minutes of a two set of time like this sample. 1st set of time : 8:00 to 17:00 2nd set of


Please Support Our Friends

Banner
FreshBooks

About

My name is John Veldboom and have been in design and web programing for just over 8 years now. Started off as a hobby in high school but it has developed into a full time job now. I always tell people that if I wasn't doing this at work each day, I would be at home doing it for free. I love it!

Please visit the contact page to drop me a message.