Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 2012-04-18, 06:05 PM   #1
pc
Shift Out / X-On
 
pc's Avatar
 
Join Date: Jul 2007
Location: unknown
Posts: 2,298
Send a message via ICQ to pc
i'm stuck in counting new lines PHP

So I have a $ckeys['keywords'] string, (extract from head meta keywords ) that pretty much looks like this:

word
word
word
word
and so on, depends how many keywords there is.

Now I wrapped every new line into a separate <p> paragraph.

Quote:
<?php echo "<p id='cell1'>" . str_replace("\n", "</p><p id='cell1'>", $ckeys['keywords']) . "</p>"; ?>
What I would like to have is to have a counter for each new line and use this counter for id='cell1' so I could have id='cell1', id='cell2', id='cell3' ...

Anyone ?



pc is offline   Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:18 PM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc