Jump to content

Php Html Double Or Single Quotes


whynot

Recommended Posts

for print html : What's Better, Faster and Optimized ?!?

 

 echo "<tr height=\"22\">
    <form action = \"{$URL}/admin/edit.php\" method=\"POST\">
      <input type=\"hidden\" name=\"login\"> 
      <td width=\"15%\" bgcolor=\"$bgcolor\"> <input type = \"text\" name = \"login\" value=" . $f['login'] . "></td>
      <td width=\"15%\" bgcolor=\"$bgcolor\">  <input type = \"password\" name = \"password\" value=" . $f['pass'] . "> </td>
    </form>
        </tr>";

 

With PHP Method 2 : ( single )

 

echo ' <tr><form action = "' . URL . '/admin/editadmins.php" method="POST"> ';
echo ' <td align="left" valign="top"><input type = "text" name = "login" value = "' . $f['login'] . '"></td>';
echo ' <td align="left" valign="top"><input type = "password" name = "password" value = "' . $f['pass'] . '"></td></form></tr>';

 

Method 3 : (With Html And Php echo )

 

<tr height="22">
<form action = "../admin/editadmins.php" method="POST">
<td align="left" valign="top"><input type = "text" name = "login" value = "<?PHP echo $f['login']; ?>"></td>
<td align="left" valign="top"><input type = "text" name = "password" value = "<?PHP echo $f['pass']; ?>"></td>
</form>
<tr>

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/257389-php-html-double-or-single-quotes/
Share on other sites

There have been several discussions on this (on this forum and other). There are also other methods that you did not include: heredoc and nowdoc methods. All of them are valid methods for creating output. The bottom line is that the performance difference of either method is so negligible that it shouldn't be a consideration for the method you use. The main thing is to find a process that works and be consistent.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.