[wp-hackers] Using eval within Wordpress for a function mixed with html

Alan Castonguay alan at verselogic.net
Tue Dec 2 03:44:54 GMT 2008


If you're just going to echo the result in the template, why not just  
include() the text file?

Alan

Sent from my iPhone

On 1-Dec-08, at 16:58, Chris <chris.hearn01 at ntlworld.com> wrote:

> Hi
> I want to evaluate the string below within myfunc() and return a  
> result ready to drop into my home page (echo $s;)
>
> For reasons I won't bore you with I want to store this fragment in a  
> text file.
> Have bashed my head with all sorts of variants, but cannot get  
> eval() to work!
>
> The bit that works directly in a page is this:
> '<a rel="external nofollow" href="'.get_bloginfo('wpurl').'/juniors/ 
> mirror"><img src="/oldsite/images/junior/.thumbs/.mirror.jpg"  
> alt="mirror.jpg" title="mirror.jpg" width="95%" /></a> <hr />';
>
> How to use eval() to get the proper result from this type of thing:
> Assuming I read the above fragment from a text file into variable $s
>
> function myfunc($s)
> eval('\$theresult= \$s;')
> return $s;
>
> So any help would be MUCH appreciated!
>
> Best regards from the UK!
> Chris
>
>
> -- 
>
>    
> *** 
> *** 
> ****************************************************************     
> Chris Hearn    *Tel:* 01625 827589    *Mob:* 07768 725141     
> *email:* chris.hearn01 at ntlworld.com     
> *** 
> *** 
> ****************************************************************     
> The information transmitted is intended only for the person or  
> entity    to which it is addressed and may contain confidential and/ 
> or privileged    material. Any review, retransmission, dissemination  
> or other use of,    or taking of any action in reliance upon, this  
> information by persons    or entities other than the intended  
> recipient is prohibited.    If you received this in error, please  
> contact the sender and delete the    material from any computer.     
> **********************************************************************
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list