Thank you Paolo
It's working as a bomb. Perfect. Exactly what I need. I thought there was someother command to do it in automatic. ;-) I was also thinking about if or switch but wasn't capable to substring anything. :-(
Do you know why this substr is giving me a pain?!!
$rest = substr ("abcdef", 1);
// returns "bcdef"
$rest = substr ("abcdef", 1, 3);
// returns "bcd"
// & this one is not returning "a" why?!!
$rest = substr ("abcdef", 0);
// it's returning abcdef instead and not "a"
I spent the whole evening with different solutions and still the manual says that I've done all okay:
If start is positive, the returned string will start at the start'th position in string, counting from zero. For instance, in the string 'abcdef', the character at position 0 is 'a', the character at position 2 is 'c', and so forth.
So, why is not displaying that "a" ?!! Am I missing here something or what?!!
So if I put it this way:
$rest3 = substr ("abcdef", 0, +1);
// Than works correctly. Crazy. ;-) My logic just can't reach that.
Grazie ancora Paolo. You saved a lot of nerves of mine. Thanx again.