WordPress at a glance
function is not described

extract_from_markers() WP 1.5.0

Extracts strings from between the BEGIN and END markers in the .htaccess file.

No Hooks.

Return

Array. An array of strings from a file (.htaccess ) from between BEGIN and END markers.

Usage

extract_from_markers( $filename, $marker );
$filename(string) (required)
$marker(string) (required)

Code of extract from markers: wp-admin/includes/misc.php WP 5.2.1

<?php
function extract_from_markers( $filename, $marker ) {
	$result = array();

	if ( ! file_exists( $filename ) ) {
		return $result;
	}

	$markerdata = explode( "\n", implode( '', file( $filename ) ) );

	$state = false;
	foreach ( $markerdata as $markerline ) {
		if ( false !== strpos( $markerline, '# END ' . $marker ) ) {
			$state = false;
		}
		if ( $state ) {
			$result[] = $markerline;
		}
		if ( false !== strpos( $markerline, '# BEGIN ' . $marker ) ) {
			$state = true;
		}
	}

	return $result;
}