<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.filesystem.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.parse-ini-string.php',
    1 => 'parse_ini_string',
    2 => 'Analysiert einen Konfigurations-String',
  ),
  'up' => 
  array (
    0 => 'ref.filesystem.php',
    1 => 'Dateisystem',
  ),
  'prev' => 
  array (
    0 => 'function.parse-ini-file.php',
    1 => 'parse_ini_file',
  ),
  'next' => 
  array (
    0 => 'function.pathinfo.php',
    1 => 'pathinfo',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/filesystem/functions/parse-ini-string.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.parse-ini-string" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">parse_ini_string</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">parse_ini_string</span> &mdash; <span class="dc-title">Analysiert einen Konfigurations-String</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.parse-ini-string-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>parse_ini_string</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$ini_string</code></span>, <span class="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$process_sections</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong></span></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$scanner_mode</code><span class="initializer"> = <strong><code><a href="filesystem.constants.php#constant.ini-scanner-normal">INI_SCANNER_NORMAL</a></code></strong></span></span>): <span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>parse_ini_string()</strong></span> Gibt die Konfiguration aus dem String 
   <code class="parameter">ini_string</code> in einem assoziativen Array zurück.
  </p>
  <p class="para">
   Die Struktur des ini-Strings ist die selbe wie die der <var class="filename">php.ini</var>
  </p>
  <div class="warning"><strong class="warning">Warnung</strong>
   <p class="simpara">
    Diese Funktion darf nicht mit unvertrauenswürdigen Eingaben verwendet werden,
    es sei denn, <code class="parameter">scanner_mode</code> ist <strong><code><a href="filesystem.constants.php#constant.ini-scanner-raw">INI_SCANNER_RAW</a></code></strong>,
    da die geparste Ausgabe Werte von sensiblen Konstanten enthalten könnte,
    wie beispielsweise Konstanten, die ein Datenbank-Passwort enthalten.
   </p>
  </div>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.parse-ini-string-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">ini_string</code></dt>
     <dd>
      <p class="para">
       Der Inhalt der ini-Datei die analysiert wird.
      </p>
     </dd>
    
    
     <dt><code class="parameter">process_sections</code></dt>
     <dd>
      <p class="para">
       Ist der Parameter <code class="parameter">process_sections</code>
       als <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> gesetzt, werden Sie ein mehrdimensionales Array zurückbekommen, welches die Abschnitte und Einstellungen enthält.
       Die Standardeinstellung <code class="parameter">process_sections</code> ist <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>      
      </p>
     </dd>
    
    
     <dt><code class="parameter">scanner_mode</code></dt>
     <dd>
      <p class="para">
       Kann entweder <strong><code><a href="filesystem.constants.php#constant.ini-scanner-normal">INI_SCANNER_NORMAL</a></code></strong> (normal) oder 
       <strong><code><a href="filesystem.constants.php#constant.ini-scanner-raw">INI_SCANNER_RAW</a></code></strong> sein. Wenn <strong><code><a href="filesystem.constants.php#constant.ini-scanner-raw">INI_SCANNER_RAW</a></code></strong> 
       angegeben ist, werden optionale Inhalte nicht analysiert.
      </p>
      <p class="para">
    Seit PHP 5.6.1 kann auch <strong><code><a href="filesystem.constants.php#constant.ini-scanner-typed">INI_SCANNER_TYPED</a></code></strong> angegeben werden.
    In diesem Modus werden soweit möglich die Typen von Boolean-, Null- oder Integer-Werten
    beibehalten. Die Zeichenketten <code class="literal">&quot;true&quot;</code>, <code class="literal">&quot;on&quot;</code> und
    <code class="literal">&quot;yes&quot;</code> werden zu <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> konvertiert. <code class="literal">&quot;false&quot;</code>,
    <code class="literal">&quot;off&quot;</code>, <code class="literal">&quot;no&quot;</code> und <code class="literal">&quot;none&quot;</code> werden
    als <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> angesehen. <code class="literal">&quot;null&quot;</code> wird in diesem Modus zu <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>.
    Soweit möglich werden alle numerischen Zeichenketten zu Integertypen umgewandelt.
   </p>
     </dd>
    
   </dl>
  </p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-function.parse-ini-string-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Die Einstellungen werden als assoziatives <span class="type"><a href="language.types.array.php" class="type Array">Array</a></span> bei Erfolg,
   und <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> bei einem Fehler zurückgegeben..
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.parse-ini-string-notes">
  <h3 class="title">Anmerkungen</h3>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <span class="simpara">
    Es gibt reservierte Wörter die nicht als Keys für die ini-Dateien benutzt
    werden dürfen. Dies schließt <code class="literal">null</code>, <code class="literal">yes</code>, <code class="literal">no</code>, <code class="literal">true</code>, <code class="literal">false</code>, <code class="literal">on</code>, <code class="literal">off</code> und <code class="literal">none</code> ein.
    Die Werte <code class="literal">null</code>, <code class="literal">off</code>, <code class="literal">no</code> und <code class="literal">false</code> geben <code class="literal">&quot;&quot;</code> zurück, und die Werte <code class="literal">on</code>, <code class="literal">yes</code> und <code class="literal">true</code> <code class="literal">&quot;1&quot;</code>,
    es sei denn der <strong><code><a href="filesystem.constants.php#constant.ini-scanner-typed">INI_SCANNER_TYPED</a></code></strong>-Modus wird verwendet.
    Die Buchstaben <code class="literal">?{}|&amp;~![()^&quot;</code> dürfen nirgendwo inm Key benutzt 
    werden und haben eine spezielle Bedeutung.
   </span>
  </p></blockquote>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.parse-ini-string-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.parse-ini-file.php" class="function" rel="rdfs-seeAlso">parse_ini_file()</a> - Parst eine Konfigurationsdatei</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>