private function formatCell($cell)
    {
        // Cast cell data to a string.
        $cell = (string) $cell;

        // Enclose the cell in double quotes, if necessary.
        if (strpbrk($cell, '"' . $this->lineBreak . $this->delimiter) !== false) {
            $cell = '"' . str_replace('"', '""', $cell) . '"';
        }

        // Standardize line breaks.
        $cell = preg_replace('/\R/u', $this->lineBreak, $cell);

        return $cell;
    }
private function formatCell($cell)
    {
        // Cast cell data to a string.
        $cell = (string) $cell;

        // Enclose the cell in double quotes, if necessary.
        if (strpbrk($cell, '"' . $this->lineBreak . $this->delimiter) !== false) {
            $cell = '"' . str_replace('"', '""', $cell) . '"';
        }

        // Standardize line breaks.
        $cell = preg_replace('/\R/u', $this->lineBreak, $cell);

        return $cell;
    }
private function formatCell ( $ cell ) { // Cast cell data to a string. $ cell = ( string ) $ cell ; // Enclose the cell in double quotes, if necessary. if ( strpbrk ( $ cell , '"' . $ this -> lineBreak . $ this -> delimiter ) !== false ) { $ cell = '"' . str_replace ( '"' , '""' , $ cell ) . '"' ; } // Standardize line breaks. $ cell = preg_replace ( '/\R/u' , $ this -> lineBreak , $ cell ) ; return $ cell ; }
Format a CSV cell.

@param string|object $cell

@return string
Format a CSV cell .