PHP: return value from function and echo it directly?
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;
}
Why return when you can echo if you need to?
function
get_info() {
$something = "test";
echo $something;
}