Re: removing chars from string
| From: | Josh Olson | Date: | Mon, 27 Jun 2005 15:56:08 +0000 |
| Subject: | Re: removing chars from string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-217696@lists.php.net to get a copy of this message | ||
> I know that it is length, and I gave the correct length for an 11 character string minus two
> characters. But as always, there is more than
> one way to skin a mule.
$string = '12345678901';
$jayString = substr($string, 0, 9);
$kevinString = substr($string, 0, 8);
echo $jayString; // echos 123456789
echo '<br />'; // echos 12345678
echo $kevinString;
It turns out to "skin" a mule is to outsmart him. Because mules aren't
actually stubborn, they're just smarter than most of us.