HTML:
<div class="mydiv">
My Div
<ul>
<li><input type="submit" value="first"/></li>
<li><input type="submit" value="second (blah blah)"/></li>
<li><input type="submit" value="third . blah blah"/></li>
</ul>
</div>
How can I retrieve the value of the input and replace any ‘(‘ or ‘.’ with a ‘\n’? The result would appear like:
second
(blah blah)
Wrote this assuming you wanted to keep the separator as your exemple implied, you can see it working here.
EDIT: @vzwick: regarding your edit no, it shouldn’t be a one-liner, I’m caching $this on purpose.