What is the simplest technique for echoing out a PDO object inside of a foreach?
<p>I'm making my first application for practice over this delightful weekend. This is where I'm currently at and am trying to figure out if there is a better technique then all of the <code>business-&gt;$column_name</code> that I'm doing and jumping in and out of PHP.</p>

<pre><code>$sql = $db-&gt;query('SELECT * FROM companies ORDER BY state ASC');
$results = $sql-&gt;fetchAll(PDO::FETCH_OBJ);

**html code snipped for space**

&lt;?php foreach($results as $business): ?&gt;
&lt;p&gt;
&lt;strong&gt;&lt;?php echo $business-&gt;name; ?&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;?php echo $business-&gt;city . ', ' . $business-&gt;state; ?&gt;&lt;br /&gt;
Call &lt;?php echo $business-&gt;phone; ?&gt;&lt;br /&gt;
&lt;!-- needs to check if website &amp; twitter are present --&gt;
&lt;?php
if (isset($business-&gt;twitter)) {
echo 'Follow us on Twitter &lt;a href="http://twitter.com/' . $business-&gt;twitter . '"&gt;@' . $business-&gt;twitter . '&lt;/a&gt;';
}
?&gt;
&lt;/p&gt;
&lt;?php endforeach; ?&gt;
</code></pre>

<p>Is there a way to clean some of this up? Especially when I get into the website and twitter stuff and have to do the <code>href</code> followed by the text it just feels messy to me.</p>
