str_getcsv

Supported Versions: PHP 5 >= 5.3.0, PHP 7, PHP 8
Parse a CSV string into an array
str_getcsv(¬†¬†¬†¬†string $string,¬†¬†¬†¬†string $separator ",",¬†¬†¬†¬†string $enclosure "\"",¬†¬†¬†¬†string $escape "\\"): array
    protected static function parseParameters($rule$parameter)

    {

        return static::
ruleIsRegex($rule) ? [$parameter] : str_getcsv($parameter);

    }
        $rule->ignore('Taylor, Otwell"\'..-"''id_column');

        
$rule->where('foo''bar');

        
$this->assertSame('unique:table,column,"Taylor, Otwell\"\\\'..-\"",id_column,foo,"bar"', (string) $rule);

        
$this->assertSame('Taylor, Otwell"\'..-"'stripslashes(str_getcsv('table,column,"Taylor, Otwell\"\\\'..-\"",id_column,foo,"bar"')[2]));

        
$this->assertSame('id_column'stripslashes(str_getcsv('table,column,"Taylor, Otwell\"\\\'..-\"",id_column,foo,"bar"')[3]));



        
$rule = new Unique('table''column');
        $rule->where('foo''bar');

        
$this->assertSame('unique:table,column,"Taylor, Otwell\"\\\'..-\"",id_column,foo,"bar"', (string) $rule);

        
$this->assertSame('Taylor, Otwell"\'..-"'stripslashes(str_getcsv('table,column,"Taylor, Otwell\"\\\'..-\"",id_column,foo,"bar"')[2]));

        
$this->assertSame('id_column'stripslashes(str_getcsv('table,column,"Taylor, Otwell\"\\\'..-\"",id_column,foo,"bar"')[3]));



        
$rule = new Unique('table''column');

        
$rule->ignore(null'id_column');