Let's say I have x amount of values, in this case let's keep it at four: 'a', 'b', 'c','d'. I insert them into an array as 'a', 'b','c', 'd'. For the next slot in the array, I take the concatenation of the first two values of a and b and they become 'ab' and I slot them into the array after 'd'. For the next slot after 'ab', I concatenate the hash values of c and d, so thats 'cd'. This is inserted after 'ab' in my array. The next slot of the array would then hold concatenation of 'ab' and 'cd' and this continues up the array for all values until I am left with one value/concatenation at the end.

So far I have only coded

<?php $val1 = "a"; $val2 = "b"; $val3 = "c"; $val4 = "d"; $myarray = array(); array_push($myarray, $val1, $val2, $val3, $val4); //print_r($myarray); ?>

I am trying to figure out a way to walk through the array in a loop and do the concatenations and I'm checking out http://www.php.net/m...n/ref.array.php but I am currently at a loss. I am not asking for the solutions, just general advice/pointers.

Thanks.