WordPress at a glance
function is not described

PO::prepend_each_line() public WP 1.0

Inserts $with in the beginning of every new line of $string and returns the modified string

{} It's a method of the class: PO{}

No Hooks.

Return

````. Null. Nothing.

Usage

$result = PO::prepend_each_line( $string, $with );
$string(string) (required)
prepend lines in this string
$with(string) (required)
prepend lines with this string

Code of PO::prepend_each_line() WP 5.7

<?php
public static function prepend_each_line( $string, $with ) {
	$lines  = explode( "\n", $string );
	$append = '';
	if ( "\n" === substr( $string, -1 ) && '' === end( $lines ) ) {
		/*
		 * Last line might be empty because $string was terminated
		 * with a newline, remove it from the $lines array,
		 * we'll restore state by re-terminating the string at the end.
		 */
		array_pop( $lines );
		$append = "\n";
	}
	foreach ( $lines as &$line ) {
		$line = $with . $line;
	}
	unset( $line );
	return implode( "\n", $lines ) . $append;
}