Page 1 of 1

How do I strip left character from a string

Posted: Mon Oct 18, 2004 12:35 pm
by terrymechan
I have

$image = "/upload/fred.jpg";

I want to strip the first charcter from $images so that $images becomes

"upload/fred.php";

What code should I use to do this

Posted: Mon Oct 18, 2004 12:36 pm
by feyd

Code: Select all

substr()[/php_man]

Code: Select all

substr($image,1)

Posted: Mon Oct 18, 2004 2:28 pm
by pickle
or [php_man]ltrim[/php_man]()

Code: Select all

$trimmed = ltrim($image,"/");