weissman
asked on
read from a consts file in php
i have a file that include constants that is used as Enivroment parameters.
in perl i can get the value of a specific variable like this:
$host=`. /xxx.consts; echo \$JBOSS_HOST`;
how to perform the same opration in PHP
note: i couldn't use parse_ini_file() because i canot change the xxx.consts file to ini
thanks a lot
in perl i can get the value of a specific variable like this:
$host=`. /xxx.consts; echo \$JBOSS_HOST`;
how to perform the same opration in PHP
note: i couldn't use parse_ini_file() because i canot change the xxx.consts file to ini
thanks a lot
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Would be helpful to see the file so we can see how it is going to interact with the PHP script.
ASKER
i have use the echo shell_exec() in the end
note: the consts was calling the shell so i call it directly from php
thanks a lot
note: the consts was calling the shell so i call it directly from php
thanks a lot
Ummm... if you used shell_exec, then why didn't you accept my answer?
Ummm... if you used shell_exec, then why didn't you accept gr8gonzo's answer?
Echo? :)
Echo Echo :)
ASKER
forgive me :)
http://www.w3schools.com/PHP/php_includes.asp
perl would also use a use/require to preload variable assignments.
What are the contents of the file?
is the xxxxx.constant file something like:
Open in new window