> implode() in php ~ Online tutorial

implode() in php

The implode()function returns a string from the element of an array

Note
  • The implode() function accept its parameter in either order.How ever for consistency with explode().you should use the document order of argument .The separator parameter of imploded is optional.
Syntax:

implode(separator,array)

Example


<?php
$str='hello india';
// it is breaks the string into an array
$exp_str=explode("",$str);
print_r($exp_str);
// it returns the string from the elements of an array
echo implode("",$exp_str);
?>

Output:
Array([0]=>hello
[1]=>india)
hello india

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: