PHP » PYTHON |
login |
register |
about
|
<?php implode( ', ', array( 'foo', 'bar', 'baz' ) ); ', '.join( [ 'foo', 'bar', 'baz' ] ) or more universal function: def implode( pieces , glue = '' ): if isinstance( pieces , list ) or isinstance( pieces , set ): return glue.join( pieces ) elif isinstance( pieces , dict ): return glue.join( pieces.values() ) return False implode(PHP 4, PHP 5) implode — Join array elements with a string Description
string implode
( string $glue
, array $pieces
)
string implode
( array $pieces
)
Join array elements with a glue string.
Parameters
Return ValuesReturns a string containing a string representation of all the array elements in the same order, with the glue string between each element. Changelog
Examples
Example #1 implode() example
<?php
Notes
|
more
Recently updated
more
Most requested
|