fork download
  1. <?php
  2.  
  3. $ini_string =<<<EOF
  4. ; Use sections if you want
  5. [MySQL]
  6. ;--/ MySQL: //Dont forget to execute Install.sql ;)
  7. ; username: //NOT NEEDED TO BE ROOT -> Acces to INSERT, UPDATE, SELECT, SHOW
  8. msusername = PHP_Default
  9.  
  10. ; password:
  11. mspassword = php
  12.  
  13. ; database:
  14. msdatabase = PHP_Default
  15.  
  16. ; host:
  17. mshost = localhost
  18.  
  19. [Sessions]
  20. ;--/ Session:
  21. ; sessionend: Time in minutes when the session will be end from last acces. Default 20 minutes.
  22. EOF;
  23.  
  24.  
  25. $ini = parse_ini_string ($ini_string);
  26.  
  27. print_r($ini);
  28. echo "Host: " . $ini['mshost'] . "\n";
  29. echo "Db :" . $ini['msdatabase'] . "\n";
  30. echo "Pass:" . $ini['mspassword'] . "\n";
  31. echo "User:" . $ini['msusername'];
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
Array
(
    [msusername] => PHP_Default
    [mspassword] => php
    [msdatabase] => PHP_Default
    [mshost] => localhost
)
Host: localhost
Db  :PHP_Default
Pass:php
User:PHP_Default