Blog Archive

In PHP, if you have a number of  static classes, how do you make sure the called class ends up calling a method back in the calling class? 

Tags: 

Recently, I had the need to determine whether an array had duplicate values in it. It didn't matter what the duplicate values were, or how many duplicates there were, either of which can be answered with array_count_values(), I just needed to know whether there were any at all; a boolean answer.

Tags: 

In a Rush? Install with Drush!

You know how to install Drupal the normal way, but there is a shortcut, if you have drush.

roundDown for php

It seems crazy that php doesn't have a native roundDown function. So, let's create one!

Tags: 

I love PhpStorm, but often, the PhpStorm help file is all but helpful. The latest problem I had was getting it to work with xdebug in the browser (again) after upgrading to version 8.

I spent the usual two lifetimes getting xdebug working (again) after upgrading to a new major version of phpStorm. Finally, I could debug a standalone php script in the IDE, but all attempts to do so from the browser were fruitless.

swf Files and Drupal 7

.swf files contain the information necessary to display Flash animation. In Drupal 6, there was a module that provided an api function swf() to generate the embed code needed. That module isn't available in Drupal 7 ... so what to do?

Don't Stress Over Local Passwords

Are you working in a multi-server environment, such as local, staging and production? If you don't have User 1 (or some other user) access in your local setup, it's easy to remedy.

Anonymous functions were added to php in version 5.3, and are most often used for assigining a function to a variable to be used later as a callback. They also are useful for declaring limited-use or one-time-use functions without declaring them in the global space.

Sometimes it is desired to receive a value BACK from an anonymous function, and how to do that is not intuitive.

First, let's look at how it works with a typical function:

 

Have you ever tried to vertically align a horizontal arrangement of list items, such as a row of horizontal menu items? Did you end up pulling your hair and giving up? The fact is, block items (as defined as such in CSS) are not meant to be vertically aligned, at least not with default styling.

The solution is a return to tables ... well, kinda sort of.

Pages

©2005-2017 Ayen Designs. Underlying theme by Kiwi Themes.