あなたが理解できるように、私はいくつかの追加情報を提供すると思いました。
あなたのコードで:
$raceramps56["short"] = "My Test Product";
$leftMenu =
'<div class="leftMenuProductButton"><?PHP echo $raceramps56["short"] ?></div>';
文字通り含めています。
これを読んでください。http://php.net/manual/en/language.types.string.php
私が最初に学習したとき、私はリテラルの ' と二重引用符の違いを理解していませんでした。特に、エコーしようとしたときに問題が発生しました。
これを見てください:
<?php
echo 'this is a simple string';
echo 'You can also have embedded newlines in
strings this way as it is
okay to do';
// Outputs: Arnold once said: "I'll be back"
echo 'Arnold once said: "I\'ll be back"';
// Outputs: You deleted C:\*.*?
echo 'You deleted C:\\*.*?';
// Outputs: You deleted C:\*.*?
echo 'You deleted C:\*.*?';
// Outputs: This will not expand: \n a newline
echo 'This will not expand: \n a newline';
// Outputs: Variables do not $expand $either
echo 'Variables do not $expand $either';
?>
' の代わりに " " を使用すると、同じ出力は得られません。
すでに質問への回答がありましたが、これがお役に立てば幸いです。