hi, I think this will make more clearance about the problem.. actully i want to compare 2 files which has all most same variable's but the values are diffrant .... for e.g. 1 file has username="abc" and other has username = "bcd" ... my actul code is like ... my first file contains ... file1.php php Code: 1. <?php 2. DEFINE <http://www.php.net/define>('_EZ_USERNAME','Username'); 3. DEFINE <http://www.php.net/define>('_EZ_PASSWORD','Password'); 4. ?> my second file contains ... file2.php php Code: 1. <?php 2. DEFINE <http://www.php.net/define>('_EZ_USERNAME','Gebruikersnaam'); 3. DEFINE <http://www.php.net/define>('_EZ_PASSWORD','Wachtwoord'); 4. ?> and third file has code like ... php Code: 1. function comp_file ($Filename){ 2. include( $Filename); 3. 4. $fpEng = "/file1.php"; 5. $lines = file <http://www.php.net/file>($fpEng); 6. foreach ($lines as $line_num => $line) { 7. $line = str_replace <http://www.php.net/str_replace>("<?php","",$line); 8. $line = trim <http://www.php.net/trim>($line); 9. if ($line == ""){ 10. next <http://www.php.net/next>($lines); 11. } 12. elseif($line == "?>"){ 13. next <http://www.php.net/next>($lines); 14. } 15. else { 16. $line = str_replace <http://www.php.net/str_replace>("DEFINE('","",$line); 17. $line = str_replace <http://www.php.net/str_replace>("','",",",$line); 18. $line = str_replace <http://www.php.net/str_replace>("');","",$line); 19. list <http://www.php.net/list>($fieldNm, $caption) = explode <http://www.php.net/explode>(",", $line ); 20. /*$$fieldNm = $fieldNm; 21. $tmp = $fieldNm ; 22. //eval($fieldNm) 23. eval("\$tmp = \"$tmp\";");*/ 24. echo <http://www.php.net/echo> $caption ; 25. echo <http://www.php.net/echo> '<input name="<?php echo $fieldNm ;?>" value="<?php //here i want value form($Filenamefile ) ; ?>" type="text" size="70">' ; 26. } 27. } 28. } 29. comp_file(file2.php); so now when i do read file2 i got $caption = 'UserName' ... and $fieldNm = '_EZ_USERNAME' by using this $fieldNm ' s value i want to use the variable of file2 .... i think this will help you more in help me out On 8/19/06, Hiren Parmar <phdhiren@xxxxxxxxx> wrote:
Hi , i have one problem regarding variable's access ... i hv defined some varibale like DEFINE('_xx_USERNAME','Username'); in one file ... and in another file , i got this variable (_xx_USERNAME) as a value of another variable ... like $filedValue = '_xx_USERNAME' ; now , the problem is i want the value of _xx_USERNAME in the second file ... that is *Username*... by using variable $filedValue ... how could i do this ? -- Hiren Parmar -- http://www.i3brains.com/
-- Hiren Parmar -- http://www.i3brains.com/