Re: [PHP] removing chars from string

2005-06-27 Thread Stut
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

Re: [PHP] removing chars from string

2005-06-27 Thread John Nichel
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

Re: [PHP] removing chars from string

2005-06-27 Thread John Nichel
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 ;)

RE: [PHP] removing chars from string

2005-06-27 Thread Jay Blanchard
[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

Re: [PHP] removing chars from string

2005-06-27 Thread Josh Olson
> 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

RE: [PHP] removing chars from string

2005-06-27 Thread Jay Blanchard
[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,

Re: [PHP] removing chars from string

2005-06-27 Thread John Nichel
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]

Re: [PHP] removing chars from string

2005-06-27 Thread Richard Davey
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

RE: [PHP] removing chars from string

2005-06-27 Thread Jay Blanchard
[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

Re: [PHP] removing chars from string

2005-06-27 Thread Kevin L'Huillier
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

RE: [PHP] removing chars from string

2005-06-27 Thread Jay Blanchard
[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