Jump to content

[SOLVED] Question


bob2588

Recommended Posts

i have a quick question

echo "<table width='914' border='1'>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td>Welcome:<?php echo" $row['FirstName'] . " " . $row['LastName']";?> </td>
    <td>Date:<? echo date('M,d,Y'); ?></td>
  </tr>

is it posiable to do this put a new php line in the echo

 

Thanks bob

Link to comment
https://forums.phpfreaks.com/topic/178758-solved-question/
Share on other sites

yes, but not that way, you dont need to start php when php is already started... just concatenate the strings

 

 

echo "<table width='914' border='1'>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td>Welcome:". $row['FirstName'] ." ". $row['LastName']."</td>
    <td>Date:". date('M,d,Y') ."</td>
  </tr>

Link to comment
https://forums.phpfreaks.com/topic/178758-solved-question/#findComment-942947
Share on other sites

Better yet, why would you want to echo the entire table that way?  The nice thing about PHP is that you can open and close PHP tags as much as you wish. 

 

<table width='914' border='1'>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td>Welcome: <?php echo $row['FirstName'] ." ". $row['LastName']; ?></td>
    <td>Date: <?php echo  date('M,d,Y');  ?></td>
  </tr>

 

That is my personal preference anyway in most cases.

Link to comment
https://forums.phpfreaks.com/topic/178758-solved-question/#findComment-942959
Share on other sites

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.