[memb_php]

Version Added 2.46.59

Summary

This shortcode enables you to run native PHP code in your content, and output the results to the browser.

Shortcode Examples

[memb_php]
echo “Hello, World!”;
[/memb_php]

Description

This shortcode enables you to run native PHP code in your content, and output the results to the browser.

The code must not be wrapped in opening and closing PHP tags, such as ‘<?php echo “Hello, World”; ?>’. It is still possible to leave and re-enter PHP mode though using the appropriate PHP tags, e.g. ‘echo “In PHP mode!”; ?>In HTML mode!<?php echo “Back in PHP mode!”;’.

The code must be valid PHP. This includes that all statements must be properly terminated using a semicolon.

A return statement will immediately terminate the evaluation of the code.

Any variables defined or changed in the shortcode will remain visible after it completes.

Caution
This shortcode uses the eval() function to perform this operation. The eval() function is very dangerous because it allows execution of arbitrary PHP code. Its use is discouraged. If you have carefully verified that there is no other option than to use this code, pay special attention not to pass any user provided data into it without properly validating it beforehand.Your webhost may have disabled this function, and if that is the case, then the shortcode will not work.

Shortcode Attributes

capture:  Capture the output of the shortcode and route it to a variable for later use. (?)

txtfmt: A comma separated list of text processing functions to be used to post process the contact fields. (?)