how do I use "<" and "&lt" with eval()?

From: Date: Wed, 31 Oct 2001 22:51:36 +0000
Subject: how do I use "<" and "&lt" with eval()?
Groups: php.general 
Request: Send a blank email to php-general+get-73087@lists.php.net to get a copy of this message
I'm not having an easy time understanding the discussion in the doc for eval(). I want to read this string from a file: xxx <?php somefunc("yyy",3); ?> zzz and then "run" it. I tried this code: <?php function somefunc($text,$n) { for($i=0;$i<$n;$i++){ echo $text; } } $string='xxx <?php somefunc("yyy",3); ?> zzz'; eval($string); ?> but I get "Parse error: parse error in eval.php(11) : eval()'d code on line 1 Do I have to use &lt; and &gt; in place of "<" & ">"? I tried several combinations, but I still get the same error. -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me a copy: I will read it here

« previous php.general (#73087) next »