Joining variables based on critera

Hi,
I am trying to find a way to join together numerous variables if they are strings and consecutive in an array.

1529 = WORD1
1530 = WORD2
1531 = WORD3
1557 = 2
1559 = WORD4
1569 = 8

The above would join words 1, 2 and 3 into a single variable, but leave word 4 on it’s own. I am not sure how to approach this so any suggestions would be much appreciated. Thanks

be some thing on the lines of counting the array
but this is not going to work as is its just a sort of help to try and get you going

[php]for($i=0;$i<100;$i++) {

if (is_string($var[$i][0]) && (not_num($var[$i][0])) {
$var = $var1.$var2.$var3
}

}[/php]

How about a switch?

Sponsor our Newsletter | Privacy Policy | Terms of Service