embed php code in ini file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bartfor
Forum Newbie
Posts: 4
Joined: Thu Aug 27, 2009 6:50 am

embed php code in ini file

Post by bartfor »

Hi there,

I was wondering if anyone has experience or ideas about using php code in ini files and parse them like You would with parse_ini_file() ?

Example config.ini

Code: Select all

 
[field1]
data1      = text
data2      = <?NOW();?>
data3      = <?dgettext('project1','hello_world')?>
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: embed php code in ini file

Post by Mark Baker »

I wouldn't recommend it, you'll probably end up having to use eval() to parse it
bartfor
Forum Newbie
Posts: 4
Joined: Thu Aug 27, 2009 6:50 am

Re: embed php code in ini file

Post by bartfor »

hmm, good suggestion, I'll give it at try, thanks
Post Reply