Where I wrote $value, you enter your entire string:
PHP Code:
$tbody = '<a href="babynames-details.php?search='
. $value . '&searchgender=' . $searchgenderTerm . '">' . $value . '</a><br />';
(put as 2 lines to make it readable on this posting)
If you dont like the build up method I used, then just echo the variables straight onto the page instead:
PHP Code:
echo 'START TABLE <table><tr><td>START TD' . PHP_EOL;
$cnt = 0;
foreach($results as $value) {
$cnt++;
echo '<a href="babynames-details.php?search='
. $value . '&searchgender=' . $searchgenderTerm . '">'
. $value . '</a><br />' . PHP_EOL;
if( ( $cnt % 10) ==0 ) {
echo '</td><td> START TD' . PHP_EOL;
}
}
echo '</tr></table> END TABLE' . PHP_EOL;
** there was an error in my first code where the opening <td> was written </td>
The link to the manual was malformed, should be rtrim
Bookmarks