store code in a variable and execute it

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • chotiwallah

    store code in a variable and execute it

    is it possible to store php-code in a variable, and later retrieve and execute it?

    like

    $var = "print 'sometext';";

    ....and later retrieve print 'sometext'; and execute it
  • CJ Llewellyn

    #2
    Re: store code in a variable and execute it

    "chotiwalla h" <chotiwallah@we b.de> wrote in message
    news:782d6cb.04 09270532.5f850d 70@posting.goog le.com...[color=blue]
    > is it possible to store php-code in a variable, and later retrieve and[/color]
    execute it?[color=blue]
    >
    > like
    >
    > $var = "print 'sometext';";
    >
    > ...and later retrieve print 'sometext'; and execute it[/color]





    Comment

    • chotiwallah

      #3
      Re: store code in a variable and execute it

      "CJ Llewellyn" <invalid@exampl e.con> wrote in message news:<cj95h2$nt o$1@slavica.ukp ost.com>...[color=blue]
      > "chotiwalla h" <chotiwallah@we b.de> wrote in message
      > news:782d6cb.04 09270532.5f850d 70@posting.goog le.com...[color=green]
      > > is it possible to store php-code in a variable, and later retrieve and[/color]
      > execute it?[color=green]
      > >
      > > like
      > >
      > > $var = "print 'sometext';";
      > >
      > > ...and later retrieve print 'sometext'; and execute it[/color]
      >
      > http://www.php.net/manual/en/function.eval.php[/color]

      thank you, that solved it

      micha

      Comment

      Working...