xampp, php, imagemagick: resize on PNG fails
2019-11-28
Problem with XAMPP: php's shell_exec()
executing imagemagick's /bin/convert
command does not convert a PNG image. There is always a message saying a lib could not be found although library is there. No such problems with JPG images, only PNG.
This is a xampp related problem.
SOLUTION
as root
:
cd /opt/lampp/lib;
mv libz.so.1 libz.so.1.orig;
ln -s /lib/x86_64-linux-gnu/libz.so.1 […]
php: convert an object to array
2019-11-09
Q: how to convert an object to array with php?
A: use the following recursive function convertObjectToArray
to achieve this.
/**
* @param mixed $mObject
* @return array
*/
function convertObjectToArray($mObject)
{
(is_object($mObject)) ? $mObject = (array) $mObject : false;
if(is_array($mObject))
{
$aNew = array();
foreach($mObject as $sKey => $mValue)
{
$sFirstChar […]