Example 1 below works:

echo "<p><h2>".$results['title']."</h2>".$results['shortdesc']."</p>";

I need to make the title linkable to the page url. I'm probably putting the ' and " in the wrong places for the link part.

Example 2 - I've added the url code but does not work:

echo "<p><h2><a href=http://www.example.com/".$results['url'].".$results['title']."</a>"</h2>".$results['shortdesc']."</p>";

Any help would be appreciated. Thx.

Recommended Answers

echo '<h2><a href="http://www.example.com/' . $results['url'] . '">' . $results['title'] . '</a></h2><p>' . $results['shortdesc'] . '</p>';
Jump to Post

All 2 Replies

echo '<h2><a href="http://www.example.com/' . $results['url'] . '">' . $results['title'] . '</a></h2><p>' . $results['shortdesc'] . '</p>';

Perfect - Thx so much!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.