i thought that would take my string, and take the last char off, how do i do it?PHP Code:$str = substr($str,strlen($str)-1);
Also, is the newline character "\n" because it isnt working correctly..
Printable View
i thought that would take my string, and take the last char off, how do i do it?PHP Code:$str = substr($str,strlen($str)-1);
Also, is the newline character "\n" because it isnt working correctly..
In windows the newline consists of two characters \r\n and in MAC OS the newline character is just a carrige return \r. To shaveo ff the last n chracters:
PHP Code:$str = substr($str, -1);
But if you're just looking to get rid of trailing whitespace, trim() would be a better choice.
Thanks guys, i resolved this myself:
vAd, that just left me with the last char, it didnt cut it off of the string (well actually i guess it did..)PHP Code:$ip = substr($ip,0,-1);
CornedBee, it isnt the same thing every time, and it is not whitespace ever, thanks though
oops :blush:
Thanks anyways, i should type clearer :wave: