Array_Unshift?
| From: | Brandon Orther | Date: | Wed, 13 Dec 2000 21:27:17 +0000 |
| Subject: | Array_Unshift? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-30176@lists.php.net to get a copy of this message | ||
Hello,
I have been trying to use array unshift in a do loop for the last hour and
the only thing in the array when it is done is the last element it add to
the array. Here is the code:
do{
if( $type == -1){
$list[$i] = "$list[$i]";
$list2 = explode ("/", $list[$i]);
$list3 = array_pop ($list2);
array_unshift($dirlist, $list3);
} else {
$list[$i] = "f$list[$i]";
}
$i++;
}while($list[$i]);
It should have 3 elements when this is done listing a dir that I have it set
to list.
Thank you,
--------------------------------------------
Brandon Orther
WebIntellects Design/Development Manager
brandon@webintellects.com
800-994-6364
www.webintellects.com
--------------------------------------------