Posts Tagged ‘array’
Get all directories in PHP
I think this may be the fastest way to get a list of all the directories in a given folder/directory using PHP. $directories = array_filter(glob(‘*’), ‘is_dir’); ..and of course you can also add a path to it if you need to: $directories = array_filter(glob($myPath.‘*’), ‘is_dir’);
Clear an array in Actionscript 3
I personally really like this way of clearing an array’s elements: Declare your array to use: var myArray:Array=new Array(); Add elements: for (var i:Number;i<10;i++) { myArray[i] = "an item"; } Clear the array: myArray.length = 0;