this might be a stupid question but …
php
function get_info() {
$something = "test";
return $something;
}
html
<div class="test"><?php echo get_info(); ?></div>
Is there a way to make the function automatically "echo" or "print" the returned statement? Like I wanna do this …
<div class="test"><?php get_info(); ?></div>
… without the "echo" in it?
Any ideas on that? Thank you in advance!
You can use the special tags:
<?= get_info(); ?>
Or, of course, you can have your function echo the value:
function get_info() {
$something = "test";
echo $something;
}