|
|
|
|
|
|
|
|
|
|
|
#1 |
|
a.k.a. Sparky
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
|
Code:
<?php
$ckeys['keywords'] = array('word1','word2','word3','word4');
$loop = 1;
foreach ($ckeys['keywords'] as $word) {
printf("<p id='cell%d'>%s</p>\n", $loop, $word);
$loop++;
}
__________________
SnapReplay.com a different way to share photos - iPhone & Android |
|
|
|
|
|
#2 |
|
Are you sure you're an accredited and honored pornographer?
Join Date: Sep 2008
Posts: 67
|
I think sparky's answer is good but addresses a slightly different question. Perhaps this is closer to the question as posed:
Code:
<?php
$ckeys = array();
$ckeys['keywords'] = <<<EOT
word1
word2
word3
word4
EOT;
foreach (explode("\n", $ckeys['keywords']) as $i => $w) {
$id = "cell" . ($i+1);
echo "<p id='$id'>$w</p>\n";
}
?>
|
|
|
|
|
|
#3 |
|
a.k.a. Sparky
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
|
You are correct, I assumed that the words were actually in his keywords array.
__________________
SnapReplay.com a different way to share photos - iPhone & Android |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|