i want to change the 3 character in my string in php
Moderator: General Moderators
-
lokesh_kumar_s
- Forum Commoner
- Posts: 48
- Joined: Mon Apr 13, 2009 5:39 am
- Contact:
i want to change the 3 character in my string in php
i want to change the third character in my string in php. the thing is i want to specify the location like three. i dont want to change character at any other position please help
Re: i want to change the 3 character in my string in php
Code: Select all
$str = 'abcd';
$str[2] = 'X';
echo $str;
-
lokesh_kumar_s
- Forum Commoner
- Posts: 48
- Joined: Mon Apr 13, 2009 5:39 am
- Contact:
Re: i want to change the 3 character in my string in php
thanks a lot yacahuma.yacahuma wrote:Code: Select all
$str = 'abcd'; $str[2] = 'X'; echo $str;