Quantcast
Channel: Implode an array without first element - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Answer by Alexis King for Implode an array without first element

$
0
0

Just copy the array, then delete the cname property before calling implode.

$copy = $arr;unset($copy['cname']);implode($copy);

This works because in PHP, array assignment copies. (Sort of bizarre, but it works.)


Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>