Category: Programming - PHP
I tried to do some Image Magick with PHP recently on an Ubuntu Feisty machine, and even though I had the required package: 'php5-imagick' installed, and I updated my php.ini with imagick.so, I kept getting the error Class 'Imagick' not found. This is how I eventually fixed it.
Or: How to convert multipage TIFF to PDF in PHP.
Let's say you have a fax with multiple pages that has been stored as a TIFF and you want to convert it to PDF using PHP for digital document flow. In this article I will show you a tiff2pdf function for PHP, because it cannot be done directly with ImageMagick.
I recently faced a programming challenge that almost broke my brain. I needed to create a function that could explode any single-dimensional array into a full blown tree structure, based on the delimiters found in it's keys. Tricky part was size of the tree could be infinite. I called the function: explodeTree. And maybe it's best to first look at an example.
If you're like me and you're interested in the stats of your website or blog, you might also want to know how many Diggs all of your articles have received. But that can become quite a pain when you have more and more articles, pages or blog posts. So why not let PHP retrieve the Digg count of your articles so you can use it in graphs or other statistic tools?
A good way for sites or articles to get known is submitting to social bookmarking sites, so submitting should be as easy as possible for your visitors. But gathering information on the best social bookmarking sites, their icons, submission URLs, and ranking is quite a pain. And so I did it for you. I'll also give you a PHP example of how to integrate social bookmarking sites in your website.
Every time a request hits your server, PHP has to do a lot of processing, all of your code has to be compiled & executed for every single visit. Even though the outcome of all this processing is often identical for both visitor 21600 and 21601. So why not save the flat HTML generated for visitor 21600, and serve that to 21601 as well? This will relieve resources of your web server and database server because less PHP often means less queries.
Not everyone knows about PHP's capabilities of making SSH connections and executing remote commands, but it can be very useful. I've been using it a lot in PHP CLI applications that I run from cronjobs, but initially it was a pain to get it to work. The PHP manual on Secure Shell2 Functions is not very practice or thorough for that matter, so I would like to share my knowledge in this how to, to make it a little less time consuming setting this up.






tagcloud