I’m new to PHP so I don’t know whether this is possible.
I need to add brackets to different timestamps so that this:
<span class="time">2:26</span>
<span class="time">2:51</span>
<span class="time">3:37</span>
<span class="time">1:19</span>
becomes this:
<span class="time">(2:26)</span>
<span class="time">(2:51)</span>
<span class="time">(3:37)</span>
<span class="time">(1:19)</span>
EDIT
The above HTML is generated using a simple DOM parser to grab info from a webpage.
If this is part of a larger HTML string or if the syntax might differ, it’s a better idea to use a DOM parser.
However, if that isn’t the case you can do this:
Or you can use regex: