array() with $variable bug?
Posted: 01 Apr 2026 16:20
When adding items to the array that have a comma in some of them, they are ripped apart, even when each entry is single quoted...
Is this a bug (can't say that I find this the expected behavior^^)?
This will output 4 echos...
Is this a bug (can't say that I find this the expected behavior^^)?
Code: Select all
$dirs = <<<'>>>'
'Hello, world!'
'You, me'
>>>;
$values = regexreplace($dirs, "\r?\n", ",");
$array = array($values);
foreach($array as $value) {
echo $value;
}