note 113582 added to function.parse-ini-string

From: Date: Thu, 31 Oct 2013 19:34:20 +0000
Subject: note 113582 added to function.parse-ini-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-197373@lists.php.net to get a copy of this message
Replacement for php_ini_string() for PHP pre 5.3 - uses php_ini_file() and streams <?php if ( !function_exists( 'parse_ini_string' ) ) { function parse_ini_string( $string, $process_sections ) { if ( !class_exists( 'parse_ini_filter' ) ) { /* Define our filter class */ class parse_ini_filter extends php_user_filter { static $buf = ''; 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 */ stream_filter_register("parse_ini", "parse_ini_filter") or return false; } parse_ini_filter::$buf = $string; return parse_ini_file( "php://filter/read=parse_ini/resource=php://memory", $process_sections ); } } ?> ---- Server IP: 72.52.91.14 Probable Submitter: 72.52.91.14 ---- Manual Page -- http://php.net/manual/en/function.parse-ini-string.php Edit -- https://master.php.net/note/edit/113582 Del: integrated -- https://master.php.net/note/delete/113582/integrated Del: useless -- https://master.php.net/note/delete/113582/useless Del: bad code -- https://master.php.net/note/delete/113582/bad+code Del: spam -- https://master.php.net/note/delete/113582/spam Del: non-english -- https://master.php.net/note/delete/113582/non-english Del: in docs -- https://master.php.net/note/delete/113582/in+docs Del: other reasons-- https://master.php.net/note/delete/113582 Reject -- https://master.php.net/note/reject/113582 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#197373) next »