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




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to