BlackBerry 10 Dev Alpha Debug Stats

Having fun playing with the new BlackBerry Dev Alpha?

There’s a lot hidden away on the new software including an onscreen output for watching the performance of the handset.

To access the diagnostics, simply place your finger at the top left of the bezel and swipe inwards. Make sure that you are using the homescreen when you do this.

Repeat to clear.

Twitter Weekly Updates for 2012-09-23

Powered by Twitter Tools

Twitter Weekly Updates for 2012-09-23

Powered by Twitter Tools

A quick way to handle both strings and arrays in PHP

Something that happens occasionally is that I need to create a function that will specifically output chunks of HTML.

A good method is to allow for functions to handle both single strings and arrays. The problem? I don’t like duplicating code. The solution? A quick convention to an array!

function arrayish($a)
{
  $a = (array) $a;

  foreach ($a as $b) {
    echo "<p>$b</p>";
  }
}

That’s it. Nice and simple!

If someone knows a more efficient way to do this, I’d love to know.