#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Location
    Cleveland area
    Posts
    0
    Rep Power
    0
    If I have a string with some PHP code, say $myVAR = '<? print "hello, world"; ?>', is there anyway I can execute that code [without writing it to a file, and then including the file]??
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    18
    eval()
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    0
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by DownRightBasic:
    If I have a string with some PHP code, say $myVAR = '<? print "hello, world"; ?>', is there anyway I can execute that code [without writing it to a file, and then including the file]??[/quote]
    You can write:
    say $yourVAR = '<? print &quot;hello, world&quot;; ?>'

  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    0
    Rep Power
    0
    sorry..this is correct
    $myVAR ='<? print &quot;hello, world&quot;; ?>'
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    0
    Rep Power
    0
    sorry..this is correct
    $myVAR ='&amp;lt;? print &amp;quot;hello, world&amp;quot;; ?&amp;gt;'
  10. #6
  11. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    You can EDIT or DELETE your own post if you made a mistake.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2000
    Location
    Indiana
    Posts
    614
    Rep Power
    15
    Not to mention that rod k was right with eval();

Similar Threads

  1. Codepupil
    By Adachic in forum C Programming
    Replies: 3
    Last Post: February 6th, 2004, 06:50 PM
  2. Ensuring a file's code doesn't cause error in another.
    By Jason Doucette in forum C Programming
    Replies: 0
    Last Post: February 6th, 2004, 12:51 PM
  3. array explode ( string separator, string string [, int limit])
    By beemee_freeserv in forum HTML Programming
    Replies: 4
    Last Post: February 5th, 2004, 10:56 AM
  4. mgetty+sendfax on RH9
    By ayrin in forum Linux Help
    Replies: 0
    Last Post: January 31st, 2004, 02:11 AM
  5. split string with irregular space patern
    By sampah95 in forum PHP Development
    Replies: 1
    Last Post: January 29th, 2004, 11:49 AM

IMN logo majestic logo threadwatch logo seochat tools logo