Re: slicing and dicing strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





he answer to his question is:

print(substr($string, 0,
strlen - 1));

http://www.php.net/manual/en/book.strings.php

Cheers,
Curtis


Stuart Dallas wrote:
> WARNING: May contain traces of sarcasm.
> 
> On 27
Jun 2012, at 23:15, Kirk Bailey wrote:
> 
>> ok, it
slices and dices, but how?
>> in python, to print all but the
last char in string FOO, we say
>> print FOO[:-1]
>>
But this seems to bark like a basset hound in php. Whyfore?
> 
> Because it's not valid syntax in PHP.
> 
>> Now
tihs tyro is seeking sage words to help me understand this.
>>
RTFM is not sage words; if you don't want to help me please don't waste
>> the bandwidth.
> 
> RTFM is the best response
to such a simple request. Seriously, how hard is
> it to do this:
http://bit.ly/MUDL80? This list is here to help you solve
>
problems, not laziness.
> 
>> Would anyone care to help
me understand this without dedicating 4
>> precious and in over
demand/under supply hours to RTFM?
> 
> If it would really
take you 4 hours to find this out via the manual or
> Google then
I think it would be 4 hours well spent: 3 hours 55 minutes
>
learning how to use the manual / Google effectively, and 5 minutes to
then
> get the answer you seek.
> 
> -Stuart
> 
> --
> Stuart Dallas
> 3ft9 Ltd
>
http://3ft9.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux