Jay Blanchard wrote:
0-8 is nine characters, which is two less than eleven, IIRC
So the length should be 9 not 8 no? Or should I go back to school?
-Stuart
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Stut wrote:
Jay Blanchard wrote:
0-8 is nine characters, which is two less than eleven, IIRC
So the length should be 9 not 8 no? Or should I go back to school?
Forgive us, it's Monday.
$newstring = substr ( $oldstring, 0, 9 );
Will knock the last two characters off of an eleven characte
Jay Blanchard wrote:
[snip]
Jay Blanchard wrote:
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.
Did you take Math in Mississippi? ;)
[/snip]
As a matter of fact ;)
[snip]
$string = '12345678901';
$jayString = substr($string, 0, 9);
$kevinString = substr($string, 0, 8);
echo $jayString; // echos 123456789
echo ''; // echos 12345678
echo $kevinString;
It turns out to "skin" a mule is to outsmart him. Because mules aren't
actually stubborn, they're just smart
> 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
[snip]
Jay Blanchard wrote:
> 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.
Did you take Math in Mississippi? ;)
[/snip]
As a matter of fact ;)
0-8 is nine characters,
Jay Blanchard wrote:
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.
Did you take Math in Mississippi? ;)
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
Hello Paul,
Monday, June 27, 2005, 4:33:35 PM, you wrote:
PN> If a have a string thats 11 characters long how can I strip off
PN> the last two characters?
$newstring = substr($string, 0, -2);
Best regards,
Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I do not fea
[snip]
Paul Nowosielski <[EMAIL PROTECTED]> wrote:
> If a have a string thats 11 characters long how can I strip off the
last
> two characters?
Jay Blanchard <[EMAIL PROTECTED]> wrote:
> $newString = substr($oldString, 0, 8);
> echo $newString;
substr's third argument is length, not position. It
Paul Nowosielski <[EMAIL PROTECTED]> wrote:
> If a have a string thats 11 characters long how can I strip off the last
> two characters?
Jay Blanchard <[EMAIL PROTECTED]> wrote:
> $newString = substr($oldString, 0, 8);
> echo $newString;
substr's third argument is length, not position. It also a
[snip]
If a have a string thats 11 characters long how can I strip off the last
two characters?
[/snip]
$newString = substr($oldString, 0, 8);
echo $newString;
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
11 matches
Mail list logo