Home Tutorial Php Phparray PHP array join

 
 

PHP array join
Posted on: October 28, 2009 at 12:00 AM
This section illustrates the use of the join function in php

  • Join function add all the elements of the given array into a single string variable.
  • It woks similar to implode function.
  • It is the alias of the implode function.


PHP Array Join() Example

<?php
$myarray
=array("c"=>"cpu","m"=>"monitor","m1"=>"mouse","k"=>"keyboard","joystick");
print_r($myarray);
$array1
=join($myarray);
echo
"<br>";
print_r($array1);
?>

Output
Array ( [c] => cpu [m] => monitor [m1] => mouse [k] => keyboard [0] => joystick )
cpumonitormousekeyboardjoystick

Related Tags for PHP array join:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.