|
|
PHP (angielski akronim rekurencyjny, którego rozwinięcie to PHP Hypertext Preprocessor), pierwotnie nazwany Personal
Home Page - skryptowy język programowania, służący przede wszystkim do tworzenia dynamicznych stron WWW i wykonywany w
tym przypadku po stronie serwera, z możliwością zagnieżdżania w HTML (bądź XHTML). PHP jest podobny w założeniach do
dużo starszego mechanizmu SSI (Server Side Includes), jednak jest w stosunku do SSI nieporównanie bardziej rozbudowany.
Udostępniany jest na zasadach licencji open-source. Jego składnia bazuje na językach C, Java i Perl.
SQL (ang. Structured Query Language) to strukturalny język zapytań używany do tworzenia, modyfikowania baz danych oraz
do umieszczania i pobierania danych z baz danych.
Język SQL jest językiem deklaratywnym. Decyzję o sposobie przechowywania i pobrania danych pozostawia się systemowi
zarządzania bazą danych DBMS.
Jest to język programowania opracowany w latach siedemdziesiątych w firmie IBM. Stał się on standardem w komunikacji z
serwerami relacyjnych baz danych. Wiele współczesnych systemów relacyjnych baz danych używa do komunikacji z
użytkownikiem SQL, dlatego mówi się, że korzystanie z relacyjnych baz danych, to korzystanie z SQL-a.
Apache jest otwartym serwerem HTTP dostępnym dla wielu systemów operacyjnych (m.in. UNIX, GNU/Linux, BSD,
Microsoft Windows). Po angielsku słowo Apache wymawia się epaczi, co brzmi tak samo jak a patchy (server), co było
określeniem tego serwera we wczesnym stadium jego rozwoju w 1995 roku, kiedy był on głównie zbiorem poprawek (patch)
nałożonych na serwer HTTP o nazwie NCSA.
Apache jest najszerzej stosowanym serwerem HTTP w Internecie. W maju 2003 jego udział wśród serwerów wynosił 62%. W
połączeniu z interpreterem języka skryptowego PHP i bazą danych MySQL, Apache stanowi jedno z najczęściej spotykanych
środowisk w firmach oferujących miejsce na serwerach sieciowych.
|
parse_ini_file
(PHP 4, PHP 5) parse_ini_file -- Parse a configuration
file
Descriptionarray parse_ini_file ( string filename [, bool
process_sections] )
parse_ini_file() loads in the ini
file specified in filename, and
returns the settings in it in an associative array. By setting
the last process_sections
parameter to TRUE, you get a
multidimensional array, with the section names and settings
included. The default for process_sections is FALSE
Notatka: This function has nothing to do with the
php.ini file. It is already
processed, the time you run your script. This function can
be used to read in your own application's configuration
files.
Notatka: If a value in the ini file contains any
non-alphanumeric characters it needs to be enclosed in
double-quotes (").
Notatka: As of PHP 5.0 this function also handles
new lines in values.
Notatka: There are reserved words which must not
be used as keys for ini files. These include: null, yes,
no, true, and false. Values null, no and false results in
"", yes and true results in "1". Characters {}|&~![()" must not be used anywhere in
the key and have a special meaning in the value.
The structure of the ini file is similar to that of the
php.ini's.
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:
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"
|
|
Przykład 2. parse_ini_file() 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);
?> |
Would produce:
Array
(
[one] => 1
[five] => 5
[animal] => Dodo bird
[path] => /usr/local/bin
[URL] => http://www.example.com/~username
)
Array
(
[first_section] => Array
(
[one] => 1
[five] => 5
[animal] = Dodo bird
)
[second_section] => Array
(
[path] => /usr/local/bin
[URL] => http://www.example.com/~username
)
)
|
|
Keys and section names consisting from numbers are evaluated
as PHP integers thus
numbers starting by 0 are evaluated as octals and numbers
starting by 0x are evaluated as hexadecimals.
|