2
0
forked from Wavyzz/dolibarr

NEW dolExplodeIntoArray can accept regex

This commit is contained in:
Laurent Destailleur
2023-04-07 16:21:51 +02:00
parent c1cbf1805a
commit 3b8406a83e
2 changed files with 17 additions and 2 deletions

View File

@@ -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));
}
/**