Mar
29
Posted by john in php, programing
Here’s a quick way to strip off characters from a string using PHP’s function substr.
<?
$var = ‘05 Delete’;
$var = substr($var,0,2);
echo($var); // returns “05″
?>
If you wanted to strip off the characters from the end of a string, just change the “2″ to “-2″ and it will strip off the last two characters.






