Warning: file_get_contents(http://helion.pl/promocje/): failed to open stream: HTTP request failed! HTTP/1.1 503 Backend fetch failed in /libs/helion/simple_html_dom.php on line 77

Warning: simplexml_load_string(): Entity: line 12: parser error : Opening and ending tag mismatch: meta line 3 and head in /libs/helion/helion-lib.php on line 834

Warning: simplexml_load_string(): </head> in /libs/helion/helion-lib.php on line 834

Warning: simplexml_load_string(): ^ in /libs/helion/helion-lib.php on line 834

Warning: simplexml_load_string(): Entity: line 18: parser error : Opening and ending tag mismatch: head line 2 and html in /libs/helion/helion-lib.php on line 834

Warning: simplexml_load_string(): </html> in /libs/helion/helion-lib.php on line 834

Warning: simplexml_load_string(): ^ in /libs/helion/helion-lib.php on line 834

Warning: simplexml_load_string(): Entity: line 19: parser error : Premature end of data in tag html line 1 in /libs/helion/helion-lib.php on line 834

Warning: simplexml_load_string(): in /libs/helion/helion-lib.php on line 834

Warning: simplexml_load_string(): ^ in /libs/helion/helion-lib.php on line 834
Pobranie danych XML zako?czy?o si? niepowodzeniem. Serwer nie zwrĂłci? danych XML lub dane by?y niepoprawne.
Notice: Undefined index: item in /libs/helion/helion-lib.php on line 676

Notice: Undefined index: item in /libs/helion/helion-lib.php on line 680
Niepoprawny identyfikator ksi??ki (ident).
Notice: Undefined index: tytul in /functions/helion.php on line 189

Notice: Undefined index: cena in /functions/helion.php on line 189

Notice: Undefined index: tytul in /functions/helion.php on line 192

Notice: Undefined index: cenadetaliczna in /functions/helion.php on line 196

Notice: Undefined index: cena in /functions/helion.php on line 196

Notice: Undefined index: znizka in /functions/helion.php on line 197
Funkcje PHP parse_ini_file
Loading:


parse_ini_fileparse_ini_file
array parse_ini_file ( string $filename [, bool $process_sections = false [, int $scanner_mode = INI_SCANNER_NORMAL ]] )


Ładuje w plik ini określony w $filename, i zwraca ustawienia w postaci tablicy asocjacyjnej



Parametry

 

filename - nazwa pliku ini do załdownia

process_sections - ustawiając ten parametr na true możesz otrzymac wielowymiarowa tablicę zawierającą nazwy i ustawinia, domyślnie FALSE


scanner_mode - może być  INI_SCANNER_NORMAL (domyślnie) lub INI_SCANNER_RAW.



 Zwracane wartości

The settings are returned as an associative array on success, and FALSE on failure.



Napisz Artykuł

Listing


//Przykład #1 Contents of sample.ini

; This is a sample configuration file
; Comments start with ';', as in php.ini

[first_section]
one = 1
five = 5
animal = BIRD

[second_section]
path = "/usr/local/bin"
URL = "http://www.example.com/~username"

[third_section]
phpversion[] = "5.0"
phpversion[] = "5.1"
phpversion[] = "5.2"
phpversion[] = "5.3"

//Przykład #2 parse_ini_file() example

Constants may also be parsed in the ini file so if you define a constant as an ini value before running parse_ini_file(), it will be integrated into the results. Only ini values are evaluated. For example:
<?php

define('BIRD', 'Dodo bird');

// Parse without sections
$ini_array = parse_ini_file("sample.ini");
print_r($ini_array);

// Parse with sections
$ini_array = parse_ini_file("sample.ini", true);
print_r($ini_array);

?>

//Powyższy przykład wyświetli coś podobnego do:

Array
(
    [one] => 1
    [five] => 5
    [animal] => Dodo bird
    [path] => /usr/local/bin
    [URL] => http://www.example.com/~username
    [phpversion] => Array
       (
            [0] => 5.0
            [1] => 5.1
            [2] => 5.2
            [3] => 5.3
        )

)|>
Array
(
    [first_section] => Array
        (
            [one] => 1
            [five] => 5
            [animal] => Dodo bird
        )

    [second_section] => Array
        (
            [path] => /usr/local/bin
            [URL] => http://www.example.com/~username
        )

    [third_section] => Array
        (
            [phpversion] => Array
                (
                    [0] => 5.0
                    [1] => 5.1
                    [2] => 5.2
                    [3] => 5.3
                )

        )

)

//Przykład #3 parse_ini_file() parsing a php.ini file
<?php
// A simple function used for comparing the results below
function yesno($expression)
{
    return($expression ? 'Yes' : 'No');
}

// Get the path to php.ini using the php_ini_loaded_file()
// function available as of PHP 5.2.4
$ini_path = php_ini_loaded_file();

// Parse php.ini
$ini = parse_ini_file($ini_path);

// Print and compare the values, note that using get_cfg_var()
// will give the same results for parsed and loaded here
echo '(parsed) magic_quotes_gpc = ' . yesno($ini['magic_quotes_gpc']) . PHP_EOL;
echo '(loaded) magic_quotes_gpc = ' . yesno(get_cfg_var('magic_quotes_gpc')) . PHP_EOL;
?>

//Powyższy przykład wyświetli coś podobnego do:

(parsed) magic_quotes_gpc = Yes
(loaded) magic_quotes_gpc = Yes

 


kontakt w sprawie miejsca



Dodano przez: igor
Ranga: Administrator serwisu Punktów: 28716
Komentarze użytkowników
    • Treść komentarza
      Kod do komentarza (opcjonalnie)
      PHP JavaScript MySQL Smarty SQL HTML CSS ActionScript
      Autor
      Token
      token

       

       








funkcje.net
Wszelkie prawa zastrzeżone©. | Funkcje.net 2008-19 v.1.5 | design: diviXdesign & rainbowcolors