I come to you because to transform an ini file into an array, I use the parse_ini_file function provided by PHP.
Extract from the ini file I want to retrieve
SocEnCoursBD=001
SocEnCoursBS=001
SocEnCours$$=001
SocEnCoursLOG=001
SocEnCoursLOV=010
Unfortunately, the parse_ini_file
function generates on the SocEnCours$$=001
line.
Error thrown :
syntax error, unexpected '$'
It looks like it doesn't support the $
character. I know that PHP does not support this character and that's why I use the option INI_SCANNER_RAW when calling the parse_ini_file
function.
Enfin voici le bout de code PHP qui traite le fichier ini :
public static function parse(string $path) : array {
return file_exists($path) ? parse_ini_file($path, true, INI_SCANNER_RAW) : null;
}
To add I use PHP 7.4. If someone has a solution, I would be interested ^^