how to select distinct values from array in php

13
Jul
0

if you have an array and want to select the unique values in php:

$array_a = array(1=>100,5=>150, 8=100, 12=>300)

$unique_values = array_unique($array_a)

returns

[1]=100

[5]=150

[12]=300

if you wan to “re-key” this numerically so you can step through it

$rekeyed_array = array_values($unique_values)

and you get

[0]=100

[1]=150

[2]=300

Filed under: php

php, javascript, flash file upload progress bar

5
Jul
0

Here is my version of file upload progress bar that is somewhat web friendly (original code by http://www.pixeline.be/). It makes use of javascript, php, and flash. It gets the job done regardless if JavaScript is turned off or on. If JavaScript is turned off in the browser the file still gets uploaded you just don’t get the progress bar.

Download here http://www.ironlasso.com/downloads/progress_bar.zip

unzip put the “progress_bar” anywhere on your site should be good to go.

Here are the files

demo.html :front end file upload form
falsh_upload.php : php file that actually does the file uploading
jqUploader.swf : flash that shows the progress bar
/files/ : destination folder of the uploaded files
various javascript and css files

Filed under: flash, javascript, php