newbtophp Posted September 21, 2009 Share Posted September 21, 2009 I have some code, and im using echo to print the code. The problem is it just prints the code. I've looked at alternatives such as print() and highlight_string() But they all print the code and not execute then print. How would i execute/run the code. For example: $string = '<?php print "hey people"; ?>'; echo($string); Would just echo: <?php print "hey people"; ?> When i want it to look like: hey people Quote Link to comment https://forums.phpfreaks.com/topic/174946-solved-execute-php-without-echoing/ Share on other sites More sharing options...
.josh Posted September 21, 2009 Share Posted September 21, 2009 eval though 95% of the time there is a way better solution to doing whatever it is you're doing that involves wanting to do that... Quote Link to comment https://forums.phpfreaks.com/topic/174946-solved-execute-php-without-echoing/#findComment-922007 Share on other sites More sharing options...
work_it_work Posted September 21, 2009 Share Posted September 21, 2009 <?$string = "hey people"; echo($string);?> is this what are u looking for?!?! if not, be more explicit.... Quote Link to comment https://forums.phpfreaks.com/topic/174946-solved-execute-php-without-echoing/#findComment-922028 Share on other sites More sharing options...
redarrow Posted September 21, 2009 Share Posted September 21, 2009 i been following this user and i think he needs functions. eval just to eval i am sure this a double post from today. Quote Link to comment https://forums.phpfreaks.com/topic/174946-solved-execute-php-without-echoing/#findComment-922030 Share on other sites More sharing options...
knsito Posted September 21, 2009 Share Posted September 21, 2009 eval() is bad... stay away :'( eval though 95% of the time there is a way better solution to doing whatever it is you're doing that involves wanting to do that... Quote Link to comment https://forums.phpfreaks.com/topic/174946-solved-execute-php-without-echoing/#findComment-922044 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.