Re: Explode/Implode array
| From: | Chris Wesley | Date: | Fri, 23 Aug 2002 18:02:14 +0000 |
| Subject: | Re: Explode/Implode array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-113825@lists.php.net to get a copy of this message | ||
$path = "path/to/myfile.txt";
$list = explode( "/", $path );
$res1 = array_shift( $list );
$res2 = implode( "/", $list );
g.luck,
~Chris
On Fri, 23 Aug 2002, Richard Fox wrote:
> I have
> $path = "path/to/myfile.txt";
> $list = explode( "/", $path );
> $res1 = $list[0];
> if (count($list)<1) res2 = "";
> else $res2 = implode("/",$list);
>
> but I know this isn't right, I have to remove $list[0] from $list first.
> How do I do this?