Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- function read_conf($file)
- {
- $out=Array();
- $c=file($file);
- foreach($c as $k=>$v){
- $e=explode("=",$v);
- $e[1]=trim($e[1]);
- $f=explode(".",$e[0]);
- $c=count($f);
- $code="$"."out";for($i=0;$i<=$c-1;$i++){$code.="["."$"."f[$i]]";}
- $code.="="."$"."e[1];";
- eval($code);
- }
- return ($out);
- }
- var_dump(read_conf("quest.txt"));
- ?>
Advertisement
Add Comment
Please, Sign In to add comment