Tips.PHP: A hidden gem in array_column

array_column can do much more than extracting a single column. Here is what you can do with array_column in PHP

By |September 10th, 2019|Blog, Code, Examples, PHP, Tips|0 Comments

Tips.PHP: Removing empty strings, NULL, FALSE, and negative numbers from Array

Often we need to remove empty elements from our array. For example when we split a string with space, we can get the words and also blank strings when there are two or more spaces put together.

We can use array_filter function for rescue. When we call array_filter with out passing the filter function it […]

By |September 14th, 2011|Blog, PHP, Tips|1 Comment

Tips.PHP: Securing ViewSource.php

I’m in the process of creating Usage examples for the brand new version of RESTler. Take a look at the work in progress version here (I would love to hear your thoughts). One of the nice features in that is the ability to see the source code.
I’m using a getsource.php which will return the […]

By |August 23rd, 2011|Blog, PHP, Tips|0 Comments

Adding an icon to all items in the List Component.

List component does not have a default icon. Easy way to add one is to add a Icon function which is very similar to the one we use with Flash v2 components. Only difference is instead of string we need to return a class reference to the image

Now we can point […]

By |December 22nd, 2006|Blog, Flex 2, Tips|0 Comments

Designing a Search Field .

Utilizing the available application space effectively is one of the important things we need to consider when designing an user interface. Olden search interfaces had two parts text input field and a search button. Then the “search”/”find”/”go” text is replaced with a lens icon. Now a days this lens icon […]

By |December 22nd, 2006|Blog, Flex 2, Tips|0 Comments

Sending Arrays with offset Index.

Last time we saw the problem with sending ActionScipt 3 Associative Array. Now we let us see where associative arrays can help.
Lets Make an Array with offset index in PHP:

$arr =array(5=>5);

in ActionScript:

var arr:Array= [];
arr[5]=5;

Sending these arrays either way they go with the missing indices filled with null, so the PHP array comes to flash […]

By |July 19th, 2006|AMFPHP, Blog, Tips|0 Comments

Easy way to Randomize an Array.

Here is the sample code to shuffle the contents of an array

By |June 10th, 2006|Blog, Flash MX, Tips|0 Comments

including Actionscript 1 files in Actionscript 2 Project.

When we are including an AS1 file in an Fla which has to be published as AS2, we need to be careful in naming the include file. There shouldn’t be any object initialized in _global which has the same name as the include file.

Say for example,

I had a include file called […]

By |June 7th, 2006|Blog, Flash MX, Tips|0 Comments

Is Running in Flash IDE?

When testing my application in IDE, I wanted to use some hard coded test data instead of Every time loading the dynamic data. System.capabilities.isDebugger is the boolean property which is true when we are testing in IDE or special Debug Player.

Here is the sample code that I’ve used

By |June 3rd, 2006|Blog, Flash MX, Tips|0 Comments

Solution for skipping files from getting cached by Server and Browser

Cache is a place to store something more or less temporarily. Web pages we’ve visited are stored in our browser’s cache directory on our hard disk. Likewise, ISPs and Web Servers cache web pages which speeds up access times for users, as the page is being read from the cache memory […]

By |January 2nd, 2004|Blog, Flash MX, Tips|0 Comments