Php implode array by newline
Php implode array by newline : You can use PHP_EOL to implode array by line break.
Php implode array by newline break
$array = implode(PHP_EOL, $array);
Which will break the string at the break line.
Php explode array at line break Example
$array = array('a','b','c'); $string = explode(PHP_EOL, $array); echo $string; // will produce // a // b // c
Advertisements
Add Comment
📖 Read More
- 1. Php json decode array example
- 2. Php 5 String Functions Reference
- 3. PHP htmlentities function
- 4. PHP script to detect mobile devices
- 5. Php export data from mysql to excel