I tried echoing something like:
<?php
echo '<div>Example Created to simplify <?php load(somefile.php); ?> </div>';
?>
It just displays Example Created to simplify.. Is there any way, simple modification of above, with which I can accomplish this.
I of course want to display Example Created to simplify and somefile.php. somefile.php and the text to not cover/block each other.
php is a server-side language. So it makes no sense to send php code to a client browser. Try it like this:
<?php
echo '<div>Example Created to simplify '.load(somefile.php).'</div>';
?>
You don't have to open php tag again inside the string. Just use concatenation:
<?php
echo '<div>Example Created to simplify' . load(somefile.php) . '</div>';
?>
See also: PHP: String Operators
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With