You're already in PHP code. When you're trying to do this:
echo "Some text <?php echo $someValue; ?> more text";
What you meant is this:
echo "Some text " . $someValue . " more text";
or perhaps this:
echo "Some text $someValue more text";
(if it's just a variable that can be auto-interpreted)
If you echo code, you're doing just that... echoing it. If you want to execute code, don't put it in a string. Just execute it.