Something like eval...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    #1

    Something like eval...

    Hello,
    I have a php file with php and html code. It looks like this:

    <html...<? ... ?</html>

    If I had this file on disk then I could just include it, but I have this
    file in string.
    When I eval() the string I got a parse error. How can I execute it?

    Regards,
    Talthen


  • IchBin

    #2
    Re: Something like eval...

    talthen.z-serwera.o2@nosp am.pl wrote:
    Hello,
    I have a php file with php and html code. It looks like this:
    >
    <html...<? ... ?</html>
    >
    If I had this file on disk then I could just include it, but I have this
    file in string.
    When I eval() the string I got a parse error. How can I execute it?
    >
    Regards,
    Talthen
    >
    >
    Make sure you have 'short_open_tag = on' in your php.ini or try this:

    <html...<?php ... ?</html>

    --
    Thanks in Advance...
    IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
    'If there is one, Knowledge is the "Fountain of Youth"'
    -William E. Taylor, Regular Guy (1952-)

    Comment

    • Wayne

      #3
      Re: Something like eval...

      On Fri, 1 Sep 2006 19:14:15 +0200, <talthen.z-serwera.o2@nosp am.pl>
      wrote:
      >Hello,
      >I have a php file with php and html code. It looks like this:
      >
      ><html...<? ... ?</html>
      >
      >If I had this file on disk then I could just include it, but I have this
      >file in string.
      >When I eval() the string I got a parse error. How can I execute it?
      Would you believe you do this:

      eval('?>'.$my_h tml_text.'<?php ');

      It's bizzare, but it works.

      Comment

      Working...