You are here : phpstringimplode

implode() - string

Join array elements with a glue string.
Parameters :
  • glue - Defaults to an empty string.
  • pieces - The array of strings to implode.

  • Syntax

    string implode
        ( string $glue
       , array $pieces
       )


    Example

    <?php$array = array('lastname', 'email', 'phone');$comma_separated = implode(",", $array);echo $comma_separated; // lastname,email,phone// Empty string when using an empty array:var_dump(implode('hello', array())); // string(0) ""?>


    Output / Return Value


    Limitations


    Alternatives / See Also


    Reference