Tag Archives: PHP

php imagick simple font rendering with automatic image canvas size

I have been working with the image imagick library for PHP (ImageMagick) for some time now. I figure its time to share what I have discovered and figured out. There is very little documentation on this amazing library for PHP, but hopefully my hours of trial and error can help those who are interested in […]

simplexml to array

Sometimes dealing with PHP’s simplexml object can be annoying, and you just wish it was a simple array. There are a ton of functions out there for that, but I’ve found this one works best =) Source: http://www.php.net/manual/en/ref.simplexml.php function simplexml2array($xml) { if (get_class($xml) == ‘SimpleXMLElement’) { $attributes = $xml->attributes(); foreach($attributes as $k=>$v) { if ($v) […]

Wack Mac newline character in utf-8

So I had a user come to me with with an error with my WYSIWYG editor in our online website builder. He would save his content, which he had pasted from OSX’s TextEdit program, then try to apply that content to his website. I have a PHP function which escapes new lines and single quotes […]