Skip to content
Advertisement

How can parse these file pattern in php?

I have some .ini file to read by PHP. Then, the styles of file contents are as follows;

JavaScript

I want some arrays with each sessions(title1, title2, title3) like this;

JavaScript

I think how to divide sessions and items in each session is important. How can I pass this file?

Advertisement

Answer

You should try to use the parse_ini_file function of PHP (https://www.php.net/manual/en/function.parse-ini-file.php), available since PHP 4.

In your case:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement