Page 1 of 1

Help with the code--new bie

Posted: Thu Feb 14, 2008 10:02 am
by m_kk
Hello,

I need to read and understand some php code and I am new to this. I have the following code. I just need to know what is echo <<<ADDFORM is . I guess its a variable. But I could not find is anywhere in the page

Code: Select all

echo <<<ADDFORM
<form method="post" action="keywsave.php?act=add&filter_keyword=$fk">
<tr>
  <td class="header" width=120>$kwstr</td>
  <td class="left_td2" colspan=3>
    <input type="text" class="input" name="keyword" size="24">
  
   <input class=button type=submit value="$addstr">
  </td>
</tr>
</form>
ADDFORM;
Thanks in advacne

Re: Help with the code--new bie

Posted: Thu Feb 14, 2008 10:14 am
by Christopher
The operator <<< means that everything between the matching labels (in you case ADDFORM) will be treated as a multi-line string. You can also now use quotes for multi-line strings in PHP, so this syntax is used less often.