Bladephp: Now with 8+ codeigniter, php, and laravel project 8+ php project From $37/Month From Rs. 2499/Month

PHP implode() Function

by
Category:php
php php function
PHP implode() Function

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

The implode function is used to "join elements of an array with a string".

The implode function in PHP is easily remembered as "array to string", which simply means that it takes an array and returns a string.

$array = array('A','B','C','D');
echo implode(" ",$array);

Output

A B C D

Another Example

$array = array('A','B','C','D');
echo implode(",",$array);

Output

A,B,C,D

0 Comments


Html code work in comment box


Related Post