Question

I got an array like this:

Array ( [0] => shop [1] => kids [2] => shorts )

Now I want all the values implode seperated with a slash /. BUT I want to pass the first key, [0].

Doing an implode() on the above will result in:

shop/kids/shorts

But I want this result:

kids/shorts

Is this possible? I can't find anything for the implode() function to start from a specific key or ignore the first array entries.

Was it helpful?

Solution

Use array_shift before the implode:

array_shift($array);
$data = implode('/', $array);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top