Jump to content

[SOLVED] soo weird.. substr


kellz

Recommended Posts

The negative is telling it to go backwards on the string. So it's going one space back, which covers the 'c', therefor only printing the 'ab'. If you put a -2 instead of -1, it would only show 'a' because it is going backwards two spots covering the last two letters.

 

Hopefully that makes a little bit of sense =] Just play around with it and you will figure out how it works.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.