我在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 – 2011-02-22 03:50:49