Saturday, April 11, 2009

PHP: Convert an array into string

You can convert a array into a string using implode() function. This function takes the joining delimiter for the array, and the array itself, and return the string.

$array = array(1,2,3,4,5,6,7);
$string = implode('', $array);
print "$string\n

You can change this into any delimiter. I mean you can pass any string, for example tab, comma, dot as glue/delimiter inside implode() function

No comments:

Get function name programaticaly - Python

This little piece of code will help you to get the function name programatically. This is very helpful when you are implementing the debug...