This question already has an answer here:
I would like to split a string efficiently into different sub strings like this :
<li><a href="">One</a></li><li><a href>Two</a></li><li><a href>Three</a></li>.....<li><a herf>Last</a></li>
I would like to split this string in 3 parts and put each string in a variable.
The first variable $first should contain the first li (<li>One</li>
)
The second variable $second should contain the rest expect the last (<li>Two</li><li>Three</li>.....
)
The third variable $third should contain the last li (<li>Last</li>
)
Anyone can help ?
</div>