This is what I use...
<?php
$a = "val1~val2~val3~val4~val5"
$b = explode("~", $a);
echo("$b[0]<BR>$b[1]<BR>$b[2]");
?>
This would print...
val1
val2
val3
..etc. You get the picture.
Of course you can use these variables in if/else statements or whatever! Arrays start with zero.
Cheers
Ron