Results 1 to 14 of 14
Oct 9, 2012, 00:58 #1
- Join Date
- Apr 2003
- daejeon, South Korea
- 1 Post(s)
- 0 Thread(s)
replace the 1st letter which is lower case to upper caseCode:
code $myVar="abCd"; $myVar1 = str_replace('a','A', $myVar) echo $myVar1; result AbCd
The result is what I wanted when I knew the first letter is "a".
But How can I change it when I don't know it?
If it is "a", I like to change it "A".
If it is "b", I like to change it "B".
If it is "c", I like to change it "C".
If it is "d", I like to change it "D".
How can I replace the first letter of $myVar to the big letter?