forked from Wavyzz/dolibarr
NEW dolExplodeIntoArray can accept regex
This commit is contained in:
@@ -1381,6 +1381,12 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase
|
||||
|
||||
print __METHOD__." tmp=".json_encode($tmp)."\n";
|
||||
$this->assertEquals('{"AA":"B\/B","CC":"","EE":"FF","HH":"GG;"}', json_encode($tmp));
|
||||
|
||||
$stringtoexplode="AA=B/B;CC=\n\rEE=FF\nHH=GG;;;\nII=JJ\n";
|
||||
$tmp=dolExplodeIntoArray($stringtoexplode, "(\r\n|\n|\r|;)", '=');
|
||||
|
||||
print __METHOD__." tmp=".json_encode($tmp)."\n";
|
||||
$this->assertEquals('{"AA":"B\/B","CC":"","EE":"FF","HH":"GG","II":"JJ"}', json_encode($tmp));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user