preg_replace

Hello,
I have all the countries within the tag select.
How to change the attribute id and inserting a corresponding value?

Code (Text):

<option value="1" id="">Afghanistan</option>

<option value="2" id="">Albania</option>

<option value="3" id="">Algeria</option>

?xactly what I would like to receive:

Code (Text):

<option value="1" id="1">Afghanistan</option>

<option value="2" id="2">Albania</option>

<option value="3" id="3">Algeria</option>

Thanks!

See original post by bumbar

Leave a Reply