How to use property file in php ?
How to use property file in php ?
What is Property file ?
Property file in php will have the .ini extension. which will be used generally for the constant informations like website_url, filepaths and key, value mappings etc.
Extension:
Its a .ini extension.
Sample Property file:
prop.ini:
Idea=12
Airtel=2
Aircel=1
(or)
Idea=12;
Airtel=2;
Aircel=1;
PHP Code to get the prop(ini file) values by its key:
[php]
<?php
$ini_array = parse_ini_file("prop.ini");
$propKey = ‘Idea’;
echo $ini_array[$propKey];
?>
[/php]
Output:
12
Download Source code:
Php Property File Source code
Please feel free to post your queries/comments…..
Php Recommended Books: