Answers.Body: <p>I believe its not possible to add php code in CiviCRM text area or ckeditor fields. I guess for security reasons it doesn't allow you to add any code snippets. Alternate solution is to use <a href="https://docs.civicrm.org/dev/en/latest/hooks/list/" rel="nofollow noreferrer">hook</a> to alter the content of the field by using tokens.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-03T09:27:16.497Z
Answers.LastActivityDate: 2018-08-03T09:27:16.497Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>Using Drupal 7 with CIVI crm 5.x<a href="https://i.sstatic.net/L15m8.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/L15m8.png" alt="enter image description here"></a></p>
  
  <p>I'm doing some testing with this:</p>
  
   Hello World</p>'; ?> 
  
  <p>Paste it in source code, but then it strips it out like this:</p>
  
  <pre><code>  &lt;!--?php echo '&lt;p--&gt;
    &lt;p&gt;Hello World&lt;/p&gt;
  </code></pre>
  
  <p>With Drupal I can tweak things so this can work, but how do I do it with CIVI CRM or it is even possible?</p>
  
Tags: <php>
Title: How can I add PHP as content with HTML editor?
ThreadText: # How can I add PHP as content with HTML editor?
  
  (Asked by: username_0 on 2018-08-03)
  
  Using Drupal 7 with CIVI crm 5.x[![enter image description here](https://i.sstatic.net/L15m8.png)](https://i.sstatic.net/L15m8.png)
  
  I'm doing some testing with this:
  
  Hello World'; ?>
  
  Paste it in source code, but then it strips it out like this:
  
  ```
    <!--?php echo '<p-->
    <p>Hello World</p>
  
  ```
  
  With Drupal I can tweak things so this can work, but how do I do it with CIVI CRM or it is even possible?
  
  **Tags:** php
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-08-03. Score: 2
  
  I believe its not possible to add php code in CiviCRM text area or ckeditor fields. I guess for security reasons it doesn't allow you to add any code snippets. Alternate solution is to use [hook](https://docs.civicrm.org/dev/en/latest/hooks/list/) to alter the content of the field by using tokens.
  
  
  ---
  
  