PHP Programing language

join() Functions in PHP
Previous Home Next
adplus-dvertising

join()

The join() function returns a string from the elements of an array.

Syntax:
join(separator,array)

In above syntax, "separator" specifies what to put between the array elements. Default is "" (an empty string) and "array" The array to join to a string

Example:

<?php
$arr = array('Gud','Morning..!!','Have','a','nice','Day!');
echo join(" ",$arr);
?>

Output:

Gud Morning..!! Have a nice Day!

Previous Home Next