* Thus wrote zhuravlev alexander ([EMAIL PROTECTED]): > > % cat temp.txt > Temperature $temp degree. > % cat temp.php > <?php > > $temp = '5'; > > $filename = "./temp.txt"; > $handle = fopen ($filename, "r"); > $code = fread ($handle, filesize ($filename)); > fclose ($handle); > print $code."<br>"; > eval("\$result = \"".addslashes($code)."\";"); > echo $result; > ?>
- or - $code = file_get_contents($filename); $result = str_replace('$temp', $temp, $code); echo $results; Curt -- If eval() is the answer, you're almost certainly asking the wrong question. -- Rasmus Lerdorf, BDFL of PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php