March 26, 2012
adding previous array values to newer array values
Question by steve
$test = 'test1/test2/test3/test4';
I am trying to get a array from that $test
above which i’d like to output like below.
Array
(
[0] => /
[1] => /test1/
[2] => /test1/test2/
[3] => /test1/test2/test3/
[4] => /test1/test2/test3/test4/
)
I’ve tried loops but can’t quite figure out how to get it quite right.