PHPには基本的な文字列の質問があります。PHPの文字列内に文字列を追加する
はのは、私は、変数$story
を持っているとしましょう:
$story = 'this story is titled and it is really good';
は、どのように私は「というタイトル」の後と前に文字列を追加する「と」に行きますか? 私は別の変数でタイトルを持っていた場合、私はこれを行うために使用することができますどのような関数やメソッド
$title = 'candy';
としましょうか?
あなただけの二重引用符を使用し、そのように、文字列内の変数を配置する必要があり$story = 'this story is titled and it is really good';
$title = 'candy';
// do something
var_dump($story === 'this story is titled candy and it is really good'); // TRUE
strを読んでくださいこれは基本的なPHPですhttp://php.net/manual/en/language.types.string.php –