Jump to content

Implode


3raser

Recommended Posts

The manual is pretty self explanatory. It takes an array and combines all the elements into a string separated by whatever delimiter you supply.

 

$arr = array('one', 'two', 'three');
echo implode('-', $arr); // one-two-three
echo implode('|', $arr); // one|two|three

 

implode.

 

edit: Oh, and if you supply no delimiter it just puts them together like this:

 

$arr = array('one', 'two', 'three');
echo implode($arr); // onetwothree

Link to comment
https://forums.phpfreaks.com/topic/205494-implode/#findComment-1075321
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.