Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove the first letter of a var and make it small 2

Status
Not open for further replies.

lukelukeluke

Technical User
Joined
Dec 23, 2003
Messages
117
Location
CH
Hi there,

I need to remove the first letter of a variable. The var is like this: "Hello There"
i want it to look like this: "ello There"

Another thing is, that i would like to make a one-letter var for example this: "D" smaller ---> "d". Anyone know how this works?

Thanks for youre ideas!
 
1)
$str='Hello There';
$str=substr($str,1);

2)
$var='D';
$var=strtolower($var);

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
for the first thing:
Code:
substr("Hello There", 1);
returns "ello There"

to make a string lowercase use:
Code:
strtolower("D")
which returns "d
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top