The other day I was looking how to create PDF files in PHP.
The first thing that came to my mind was the PDFlib extension included in PHP since version 4. The problem with this library is that I thought it was kind of low-level, and I didn’t had any idea on where to start.
In fact, [...]
Tag Archive > PHP
TCPDF: excelent library for generating PDF in PHP
PHP amazingly improves itself
This was me, looking how to install PHP 5.3 in the new Ubuntu Karmic, because using the new functionality of late static binding will simplify my code, and I’ve found something amazing. A new feature that was missing in PHP, but they have included in PHP 5.3…
the…
wait for it….
wait for it….
wait for it….
GOTO
It’s amazing how [...]
Detecting an animated GIF in PHP
Following function detects if the GIF contains an animation (it has more than 1 frame) or is just a static file.
function isAnimatedGif($filename)
{
$filecontents=file_get_contents($filename);
$str_loc=0;
$count=0;
// There is no point in continuing after we find a 2nd frame
[...]
Keeping aspect ratio when scaling an image
Scaling an image to keep it under specific bounds, for visualizing purposes is a common task, but it’s even better if we can scale the image without deforming it. In this cases we have to scale the image and keep it’s original aspect ratio.
Nowadays there are thousands of libraries for any general purpose language that [...]
Convert UTF-8 string into an array of chars in PHP
I hope PHP 6 will solve all my problems with UTF-8, but it has not been released yet, and one has to keep coding with the tools it has available.
I think I will probably be sharing the class for string manipulation that I’ve been coding (which of course is 100% compatible with UTF-8).
For now, I’m [...]
Superfast tokenizer in PHP
I am currently working on a PHP library/framework (I think it looks more like a library than a framework, and I think it’s better this way).
The thing is that for some of the components I needed to parse some data (look at parser definition), and for that task I needed a PHP tokenizer (or PHP [...]
Español