Home › Forums › General Issues › Execute PHP In Text Field? › Reply To: Execute PHP In Text Field?
Hi @john.marcello
PHP has a function called eval which you can use to run PHP functionality from a string:
http://www.php.net/eval
So you could run it like this:
eval( get_field('field_name') );
The only problem you will have is that your ‘string’ is not PHP, it is HTML with some PHP in it. I’m not sure if the eval function will recognize opening and closing PHP tags.
This is something that Google will know more about than me.
Good luck
Thanks
E
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.