You are here: Re: using echo but need something to execute php code « PHP Programming Language « IT news, forums, messages
Re: using echo but need something to execute php code

Posted by Janwillem Borleffs on 04/28/07 21:38

Jon Slaughter wrote:
> Is there any command that essentially executes the code and then
> echo's it?

For this specific case you could use eval:

$code = "?><body>blah<?php echo 'Hello'; ?></body>";
eval($code);

Note that the closing tag at the beginning of the eval string is mandatory.


JW

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация