Search code examples
javascriptphpecho

How to call echo inside URL include?


I want to do this: <?php include_once ("includes/'<?php echo $mymodule1; ?>'.php"); ?>

I try before with: <?php include_once ("includes/'.echo $mymodule1.'.php"); ?>

But not work :(

You can help me?, many thanks :)


Solution

  • include_once isn't really a function. Only kind of.

    Putting a variable in a string:

    include_once "includes/{$mymodule1}.php";