Documentation

Info
in package
implements ByteSequence

FinalYes

Table of Contents

Interfaces

ByteSequence
Defines constants for common BOM sequences.

Methods

fetchBOMSequence()  : string|null
Returns the BOM sequence found at the start of the string.
getDelimiterStats()  : array<string, int>
Detect Delimiters usage in a {@link Reader} object.

Methods

fetchBOMSequence()

Returns the BOM sequence found at the start of the string.

public static fetchBOMSequence(string $str) : string|null

since version 9.16.0

use League\Csv\Bom::tryFromSequence() instead

If no valid BOM sequence is found an empty string is returned

Parameters
$str : string
Tags
see
Bom::tryFromSequence()
codeCoverageIgnore
Return values
string|null

getDelimiterStats()

Detect Delimiters usage in a {@link Reader} object.

public static getDelimiterStats(Reader $csv, array<string|int, string> $delimiters[, int<-1, max> $limit = 1 ]) : array<string, int>

Returns a associative array where each key represents a submitted delimiter and each value the number CSV fields found when processing at most $limit CSV records with the given delimiter

Parameters
$csv : Reader
$delimiters : array<string|int, string>
$limit : int<-1, max> = 1
Return values
array<string, int>

        
On this page

Search results