Skip to content

Instantly share code, notes, and snippets.

@jeremyboggs
Last active October 20, 2016 12:30
Show Gist options
  • Save jeremyboggs/180cb1e7ebb61944ec2054a8fdbeecff to your computer and use it in GitHub Desktop.
Save jeremyboggs/180cb1e7ebb61944ec2054a8fdbeecff to your computer and use it in GitHub Desktop.

Is there a label or name for this task?

Converting this:

<?php
echo "<div class=\"db_result_sub_area\"><strong><a href=\"radial_graph.php?person_id=" . $unique_id . "\" target=\"_blank\">Explore Radial Graph</a></strong> (opens in new tab)</div>\n" ;
echo "</div>";
?>

to this:

<div class="db_result_sub_area">
  <strong><a href="radial_graph.php?person_id=<?php echo $unique_id; ?>">Explore Radial Graph</a></strong></div>
</div>

Functionally, it works as before, but the latter basically simplifies the PHP and privileges the HTML. It makes the HTML more readable, and does better syntax highlighting.

Basically, I know why I want to do it this way, but want to share those reasons in a way succinct enough to include in, say, a Git commit message.

Links to style guides or recommendations would be great.

@jeremyboggs
Copy link
Author

See php/html coding style at least for support of the latter over the former.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment