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.
私は変数を持っています$teste = hiiiii
$teste = hiiiii
変数を引用符と二重引用符で囲む必要があります。このような:
"'$teste'"値はこれです"'hiiiii'"
"'$teste'"
"'hiiiii'"
連結しようとしていますが、うまくいきません。どうやって?
引用符をエスケープできます:
echo "\"'$teste'\"";
印刷されます:"'hiiiii'"
次のように実行できます。
$result = '"\'' . $teste . '\'"';
これにより、次のようになります"'hiiiii'"。
デモ
購入前にお試しください
一重引用符と二重引用符の基本的なチートの使用
$test = 'hi'; echo '"'."'".$test."'".'"'; echo "'".'"'.$test.'"'."'";