Tag Archive: php

PHP: Use from Windows command line

In today‚Äôs post I will show you how you can use the PHP scripting language on a Windows machine without requiring any installation. There are a number of advantages to this. As a first bonus, you can use existing skills you have to do certain tasks on your windows machine. Additionally, because no installation of …

Continue reading »

PHP: Switch structure to check variable

Suppose you want to use PHP check the variable $var and see if it smaller than, equal to or larger than zero. There are two ways to go about this: switch($var) { case 0: echo “Equal to zero”; break; case ($var0): echo “Larger than zero!”; break; } The issue with this code is that if …

Continue reading »

PHP: Get last iteration in a for..each loop

Find out how to check if you are currently in the first or last iteration of your foreach loop in PHP.

Enable image upload in FCKEditor

My goal is to enable image uploading in FCKEditor. I am using FCKeditor in order to allow a customer to create HTML e-mails that can be sent to their clients using PHPList (2.10.12). What I would have thought is something that should work at the click of a button took me a few hours to …

Continue reading »

Read bookmarks from PDF on-the-fly using PHP

This simple script will allow you to read all the bookmarks from a PDF file dynamically, using only PHP! Make sure you have enough memory available, or it might fail on large PDF files. You use the script as follows: 1) Give in the real path to the PDF file in fpath. 2) Make sure …

Continue reading »