preg replace - preg_replace match times variable php -
following idea
$aufnahme = "annaberg"; $i="2"; $zwei=preg_replace("/\a.{"$i"}/", ' ', $aufnahme); it should remove number of variable $i, of the beginning word
means $i="2" //shows "naberg"
how can it?
you're pretty close, syntax off:
$aufnahme = "annaberg"; $i="2"; $zwei=preg_replace("/\a.{".$i."}/", ' ', $aufnahme); echo $zwei; if want replace first $i characters, substr($aufnahme, $i);
Comments
Post a Comment