Jump to content

Recommended Posts

?>

		<dt> </dt>
		<dt><span class="newsdate"><?php echo $news[0]['date']; ?></span><?php echo $data[0]['title']; if(acc_status(getUsername()) > 2) echo '<a href="acp.php?edit='. $row['id'] .'"> [Edit]</a>'; ?></dt>
		<dd>
		<table width="100%"><tr>
		<td style="text-align: justify; vertical-align: top;"><?php echo stripslashes(shorten($row['content'], 150)); ?></td>
		<td style="padding-left: 1em; text-align: right; vertical-align: top;">
		<?php echo $img; ?>
		</td></tr></table>
		<div style="margin-top: 0.5em;"><a href="news/newsarticle.php?id=<?php echo $row['id']; ?>">Read more...</a></div>
		</dd> 

		<?php

 

or if it was actually in the PHP using echo instead?

Link to comment
https://forums.phpfreaks.com/topic/264679-what-do-you-consider-neater/
Share on other sites

I prefer that. If it's outside the PHP tags then the IDE can analyze the HTML (syntax highlighting, errors and warnings, autocomplete, etc).

 

Personally I'd even put that one you echo as HTML too.

</pre>
<dt> 2) { ?>
     [Edit]

I prefer that. If it's outside the PHP tags then the IDE can analyze the HTML (syntax highlighting, errors and warnings, autocomplete, etc).

 

Personally I'd even put that one <a> you echo as HTML too.

<dt><span class="newsdate"><?php echo $news[0]['date']; ?></span><?php echo $data[0]['title']; if(acc_status(getUsername()) > 2) { ?>
    <a href="acp.php?edit=<?php echo $row['id']; ?>"> [Edit]</a>
<?php } ?></dt>

 

Thanks for the reply.  :P

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.