Need php code’s output to display underneath a Divi Module

If you are using DiviBuilder and you need to inject some custom php code to be run, and render inside divi generated block. You can create your custom shortcode and use it inserting into divi’s wysiwyg blocks.
Shortcodes are custom tag like structures but use [] instead of <> as in html – their mission is to execute your custom php code to generate html or perform some other actions on page. In both cases function which renders shortcode returns string of html, so shortcode gets replaced in result page with it’s generated html.

This code below can be placed in your theme’s functions.php or as a plugin.

function your_shortcode_renderer($atts=array(), $content=""){

// below are different return just to demonstrate approaches of shortcode creation - use one return for your shortcode.
   return '<h2>Hello World</h2>'; // example of static or dynamic something rendered.
   return '<h2>' . $content . '</h2>'; // example of utilizing wrapped shortcode's content.
   // sure you can pass in some variables as shortcode attributes and they will be in $atts associative array.
}
add_shortcode('your_custom_shortcode', 'your_shortcode_renderer');

So in Divi builder’s wysiwyg, or inside wordpress page’s content you can then place your shortcode like this:

[your_custom_shortcode] – just to render shortcode generated content, or

[your_custom_shortcode some="atribute_value"] if you need to pass in some values, or

[your_custom_shortcode] Some inner content [/your_custom_shortcode] – to utilize shortcode’s wrapping some content feature, so you can use this wrapped content inside shortcode renderer.

Hope this helps.