私はちょうどPHPを学び始めていて、私はPHP for the Webを使っています:ビジュアルクイックスタートガイド第4版と私はこの本で学んだスクリプトについて質問しています。PHPではシングルクォート文字列とダブルクォート文字列の違いは何ですか?
これは、スクリプトのコードです:
print '<p>Thank you, ' .$title.$name. ' for your comments.</p>
<p>You stated that you found this example to be "'.$response.'" and added:<br />'
.$comments.'</p>';
print "<p>Thank you, $title $name for your comments.</p><p>You stated that you found this example to be '$response' and added:<br/>$comments</p>";
このスクリプトは、単にPOST経由で引っ張られ、HTMLフォームからいくつかのデータを表示しています。
これを行う正しい方法は何ですか?この文脈では、'
対"
を理解することに多くの問題があります。
2番目の例は、本の中の1つで、最初の例は、「vs」質問を理解しようとした後のやり方を見つけた例です。 '
"
対。
*(参考)* http://www.php.net/manual/en/language.types.string.php – Gordon