Page 1 of 1

Needing to remove a few characters

Posted: Mon Jun 19, 2006 2:09 pm
by Bigun
I need to remove the first two characters from a string, how do I do that?

Posted: Mon Jun 19, 2006 2:10 pm
by Benjamin

Code: Select all

substr

Posted: Mon Jun 19, 2006 2:11 pm
by John Cartwright

Code: Select all

$string = 'blahblah';

echo substr($string, 2);
Edit | Too late :(

Posted: Mon Jun 19, 2006 2:25 pm
by Bigun
Why is this code:

Code: Select all

$b-uid = substr($_COOKIE["cg_uid"], 2);
Giving me this error:

Code: Select all

Parse error: parse error, unexpected '='

Posted: Mon Jun 19, 2006 2:27 pm
by John Cartwright
- is not a valid variable character