Jump to content

How to number <span>


miccomte

Recommended Posts

Hello,

I have difficulties doing the below task with PHP, does anyone can help?

 

I have an HTML file containing some span tags encapsulating numbers: <span>1</span>...<span>10</span>...<span>5</span>...<span>7</span>

 

I would like to replace the numbers with serial number, incremented by 1 for each span: <span>1</span>...<span>2</span>...<span>3</span>...<span>4</span>

 

Any idea?

Link to comment
https://forums.phpfreaks.com/topic/195332-how-to-number/
Share on other sites

Thanks, but it will just display <span>1</span><span>2</span><span>3</span><span>4</span>...

 

What I want is to REPLACE something like that:

<span>1</span>...<span>10</span>...<span>5</span>...<span>7</span>

 

with something like that:

<span>1</span>...<span>2</span>...<span>3</span>...<span>4</span>

 

 

Link to comment
https://forums.phpfreaks.com/topic/195332-how-to-number/#findComment-1027008
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.