I have a string like so:
$variable = "here is<br/>my code";
I want to trash anything after the <br/>
. How can I go about this?
I have a string like so:
$variable = "here is<br/>my code";
I want to trash anything after the <br/>
. How can I go about this?
<?php
echo strtok('here is<br/>my code','<') . '<br/>';
Output:
here is<br/>
With the caveat that the split here is on the <
character not necessarily a <br/>
.