parse_ini_string
Parse_ini_string() doesn't exist pre PHP 5.3.
Description
(array|bool) parse_ini_string( $string, $process_sections );
Returns (array|bool)
Parameters (2)
- 0. $string
- The string.
- 1. $process_sections
- The process sections.
Usage
if ( !function_exists( 'parse_ini_string' ) ) { require_once ABSPATH . PLUGINDIR . 'all-in-one-seo-pack/inc/aioseop_functions.php'; } // The string. $string = null; // The process sections. $process_sections = null; // NOTICE! Understand what this does before running. $result = parse_ini_string($string, $process_sections);
Defined (1)
The function is defined in the following location(s).
- /inc/aioseop_functions.php
- function parse_ini_string( $string, $process_sections ) {
- if ( ! class_exists( 'parse_ini_filter' ) ) {
- /**
- * Class parse_ini_filter
- *
- * Define our filter class.
- */
- class parse_ini_filter extends php_user_filter {
- static $buf = '';
- /**
- * The actual filter for parsing.
- *
- * @param $in
- * @param $out
- * @param $consumed
- * @param $closing
- *
- * @return int
- */
- function filter( $in, $out, &$consumed, $closing ) {
- $bucket = stream_bucket_new( fopen( 'php://memory', 'wb' ), self::$buf );
- stream_bucket_append( $out, $bucket );
- return PSFS_PASS_ON;
- }
- }
- // Register our filter with PHP.
- if ( ! stream_filter_register( 'parse_ini', 'parse_ini_filter' ) ) {
- return false;
- }
- }
- parse_ini_filter::$buf = $string;
- return parse_ini_file( 'php://filter/read=parse_ini/resource=php://memory', $process_sections );
- }