array_merge – And the winning key is!

Just a note to self about PHP array_merge The later array passed into array_merge overwrites the former, also if it’s indexed with numerical keys then the values will just be appended. <?php $option_array = [ 'element' => 'ooa1', 'optionb' => 'ob1',...

read more

Netbeans Removes Indent from // Comments

Been using netbeans for PHP development and discovered that it will remove the leading whitespace from comments and then the comments inside a block of code are hard up against the left margin which looks weird. Not sure if there is a setting to stop this behaviour...

read more

CakePHP 3 Changes To Date/Time Formatting

The new date objects have different formatting strings http://www.icu-project.org/apiref/icu4c/classSimpleDateFormat.html#details $this->Time->format($assigned_part->start_time, 'h:mm') $this->Time->format($mtg->date, 'eeee MMMM d') The old ones here...

read more

I have no idea what the problem is PHP CLI

Trying to do some PHP tutorials using vim and running php from the command line and I get…. nothing back. If it’s a syntax error (e.g. a missing line ending ; ) then no reply at all. If the syntax is correct and it’s something else then the error...

read more

CakePHP POST Failing

I was just trying to submit about 10 x 15 records… and found that cakephp was failing with a validation error. Found out it was due to the following in the php error log. [09-Jun-2016 19:16:22 Australia/Melbourne] PHP Warning:  Unknown: Input variables exceeded...

read more

Adding new fonts to TCPDF

Less agony way of doing it. Download your fonts and then run the following cd  /Users/jmcd/Sites/clam/vendor/tecnickcom/tcpdf tools/tcpdf_addfont.php -i /Users/jmcd/Downloads/liberation-sans/LiberationSans-BoldItalic.ttf cd fonts/   ls | grep libera...

read more