views:

45

answers:

2

How can I delete a character from string in PHP ?

$s = "waseem";

Are there a function like delChar($s , 2); ? which 2 is the index of the Character , I search but I didn't find anything . any ideas ?

+7  A: 

substr_replace is what you want.

$s = substr_replace($s, '', 2, 1);
Ayman Hourieh
+1  A: 
$s[2] = '';
pts