字符串我有我的代碼段看起來像這樣:使用「<" and ">」在PHP
$accounts[] = array("id" => 1, "fullName"=>"Lorem ipsum", "email"=>"[email protected]");
$accounts[] = array("id" => 2, "fullName"=>"Lorema ipsum", "email"=>"[email protected]");
$toUsers = array();
foreach($accounts as $account){
$toUsers[] = $account['fullName'] . "<" . $account['email'] . ">";
}
$toString = implode(", ",$toUsers);
這個循環應該給我一個字符串,格式如電子郵件標頭(我想用郵件功能)。 我希望得到的結果是$toString = "Lorem ipsum<[email protected]>, Lorema ipsum<[email protected]>";
但我得到的是$toString = "Lorem ipsum, lorema Ipsum";
什麼我需要做的就是「<」和「>」在PHP中的字符串的工作?
感謝,JNK
括號應該在那裏,但可能因爲瀏覽器(因爲它認爲它們是HTML標記)而看不到它們。請參閱:http://codepad.org/9ehPQ1VL – NullUserException 2011-03-03 20:32:10
你在哪裏輸出這個?在HTML中? – 2011-03-03 20:32:21
它是「看起來像」還是「完全像」?我看過使用'「<?」'和'「<?php」'的問題,但沒有。 – 2011-03-03 20:33:29