note 100594 deleted from function.parse-ini-string by googleguy
| From: | googleguy@php.net | Date: | Thu, 13 Jun 2013 14:28:13 +0000 |
| Subject: | note 100594 deleted from function.parse-ini-string by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-195197@lists.php.net to get a copy of this message | ||
Note Submitter: Safak Ozpinar (safakozpinar at gmail dot com)
----
Function parse_ini_file doesn't parse a remote ini file if allow_url_include is off. But if
allow_url_fopen is on, you can use parse_ini_string to parse a remote ini file after read its
contents.
<?php
/**
* Assume that; allow_url_include=0 and allow_url_fopen=1
* (default values in php.ini)
*/
$iniUrl = 'http://example.com/remote/config.ini';
/**
* Warning: parse_ini_file(): http:// wrapper is disabled in the server
configuration by allow_url_include=0
*/
$config = parse_ini_file($iniUrl);
/**
* works fine
*/
$config = parse_ini_string(file_get_contents($iniUrl));
?>