How to learn PHPimplode (). How to learn PHPimplode () implode function understanding 1 implode () function combines array elements into a string. 1. how to understand array elements; 2. whether the array element is the target object; 3. how to learn PHP implode ()
Implode function understanding 1
The implode () function combines array elements into a string.
1. how to understand array elements;
2. whether the array element is a target object;
3. whether the purpose is to integrate into a string;
Implode function understanding 2
Syntax
Implode (separator, array)
1. whether the implode parameter 1 separator is added to each key value of the array;
2. whether the implode parameter two array is an array of objects;
Parameters
Description
Optional. Specifies the content to be placed between array elements. The default value is "" (null string ).
Array is required. Array to be combined as a string.
Description
Although the separator parameter is optional. However, we recommend that you use two parameters for backward compatibility.
1. is the separator parameter optional;
2. required for implode parameter 2 arra;
Tips and comments
Note: implode () can receive two parameter sequences. However, explode () cannot be used for historical reasons. The separator parameter must be set before the string parameter.
Implode function 3
$ Arr = array ('H', 'I', 'J', 'K! ');
Echo implode ('M', $ arr );
?>
Output result: Hm Im Jm K!
$ Arr = array ('H', 'I', 'J', 'K! ');
Echo implode ('', $ arr );
?>
Output result: h I J K!
The aggregate implode () implode function understands 1. The implode () function combines array elements into a string. 1. how to understand array elements; 2. whether the array elements are the objects to be applied; 3...