2011-08-02 6 views
0

誰かがなぜPHPのメールの中のhtml

'を説明してくれますか? $終わり。 '!

は、

'と同じ方法で動作しません。 $挨拶。 '!

次のコードにありますか?私は行方不明で何ですか?

    $salutation = 'Greetings, ' . $cname; 
       $ending = 'Thank you for using HammerPins, ' . $cname; 

       $subject = 'Hammerpins.net Alert: Newly Added Bowling Tournaments'; 
       $message = ' 
       <html> 
       <body> 
        <p>' . $salutation . '!</p> 
        <p>New tournaments were added to the HammerPins database this week in the following counties:</p>'; 
        foreach ($user_array as $single_user_item) { 
         $message .= "$single_user_item[link]"; 
        }' 
        <p>' . $ending . '!</p> 
       </body> 
       </html> 
       '; 

ありがとうございました。

答えて

3

foreachループの直前で元のステートメントを終了したためです。代わりにこれを試してみてください:

   $salutation = 'Greetings, ' . $cname; 
      $ending = 'Thank you for using HammerPins, ' . $cname; 

      $subject = 'Hammerpins.net Alert: Newly Added Bowling Tournaments'; 
      $message = ' 
      <html> 
      <body> 
       <p>' . $salutation . '!</p> 
       <p>New tournaments were added to the HammerPins database this week in the following counties:</p>'; 
       foreach ($user_array as $single_user_item) { 
        $message .= "$single_user_item[link]"; 
       } 
       $message .= '<p>' . $ending . '!</p> 
      </body> 
      </html> 
      '; 
+0

の閉鎖}の後に私はそれを信じていません。!私はすでにそれを試していたと本当に思ったが、そうは思わない。助けてくれてありがとう! –

1

あなたは$メッセージを逃している= foreachの