i want to change the 3 character in my string in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
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

Post by lokesh_kumar_s »

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
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: i want to change the 3 character in my string in php

Post by yacahuma »

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

Post by lokesh_kumar_s »

yacahuma wrote:

Code: Select all

 
  $str = 'abcd';
  $str[2] = 'X';
  echo $str;
 
thanks a lot yacahuma.
Post Reply