Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
重複の可能性: phpでの一重引用符と二重引用符の文字列の違い
変数の名前をテキスト文字列のすぐ内側に含め、文字列を一重引用符ではなく二重引用符で囲むと、その場所に値を挿入できます。
一重引用符の場合に機能しないのはなぜですか?
これは、一重引用符と二重引用符の意図された違いです。二重引用符は、インタプリタで何かを置き換える必要がある場合に使用され、一重引用符は、文字列がそのままになることをphpに通知します。