Difference between join and implode in php.
Posted by Raj
Difference between join and implode in php.
In this example, I will show how to use join and implode in php.
Join : Join is an Alias of implode().
Example:
<?php
$arr = array('Rajesh', 'India', 'Tutorials');
$str = join(",", $arr);
echo $str;
?>
Output: Rajesh,India,Tutorials.
implode: implode Returns a string from array elements.
Example:
<?php
$arr = array('Rajesh', 'India', 'Tutorials');
$str = implode(",", $arr);
echo $str;
?>
Output:Rajesh,India,Tutorials.
This entry was posted on October 4, 2009 at 12:14 pm, and is filed under
implode,
join,
PHP,
PHP interview questions and answers
.You can leave a response, or trackback from your own site.