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
How do I strip left character from a string
Moderator: General Moderators
-
terrymechan
- Forum Newbie
- Posts: 2
- Joined: Tue Apr 08, 2003 6:40 am
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
substr()[/php_man]Code: Select all
substr($image,1)or [php_man]ltrim[/php_man]()
Code: Select all
$trimmed = ltrim($image,"/");Real programmers don't comment their code. If it was hard to write, it should be hard to understand.