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 removes all values that evaluate to...

Read More

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 source code of any php file when the relative path is passed as a query parameter. It is...

Read More

Better Object-toAS() Code

As you all already know my Object.toAS() code does fail with circular references. Ampre has replied with the following code in prototype, which is sleeker and also can addresses the circular reference issue to some extent. Here is that code [UPDATE] included the ActionScript 3 version as well It became lot more simpler with the regular expressions ActionScript 3.0 ...

Read More

Object.copyProperties(toObj, PropertyStr, exclude?)

When you need to copy only certain properties of one object to another object, this code will be useful. I’ve also given an example on how to use it. take a look at it here

Read More

Syntax Highlighting ActionScript.

Creating html tags to color highlight actionscript will be very useful for flash related websites. I’m talking about this for long time. I’m still in the process of creating one with flash itself in my spare time. My current code takes more time to this highlighting. Still I’ve not given it up I also thought of server side solutions. Before starting to make one myself, I...

Read More