say, i have a string like $x=”History[424]<“; how to remove the last “<” and make the string $x=”History[424]”; … I tried str_replace and don’t know, its not working… :(. Thx in advance
for($k=0;$k<$i;$k++) {
$linklabelmod[$k] = str_replace($linklabel[$k], $linklabel[$k]."[$k]", $linklabel[$k]);
//$var= str_replace($linklabel[$k], $linklabelmod[$k], $var);
print $linklabelmod[$k].'< ';
//print $linklabel[$k].' ';
print $link[$k].'<br>';
}
This would ensure that
<is only ever removed from the end of the string, and not from anywhere else within the string;