Determine whether code is html or php and return value -


in wordpress theme having option textarea user can write code , store database string.

so here output want check whether code written php or html tag or anything. may force user wrap them php code <?php ... ?> , remove before output it. html can write straight.

here looking , don't know how determine

if(get_option()){      $removed_php_tag = preg_replace('/^<\?php(.*)\?>$/s', '$1', $code);     return eval($removed_php_tag);  } esle if(get_option()) {      return $code;  } 

if eval() answer you're asking wrong question.

if want output html wrote in text box, use echo or print.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -