replace a string only when the 1st piece of string are in the x position
Here I try to make an editor that replace a string in particular position of the file.
Like
$file = FFFFFFF
$string = 'FFFF';
$replace = '0000';
$position = '2';
so what I want is some kind of function
that search for $string and replace with $replace but only if the string's 1st(or nore than one) letter are in $position of the $file....
so, after replace, it will be
F0000FF
any one show me how to do that? because I don't know how to use any expression to use the $position var
Here I try to make an editor that replace a string in particular position of the file.
Like
$file = FFFFFFF
$string = 'FFFF';
$replace = '0000';
$position = '2';
so what I want is some kind of function
that search for $string and replace with $replace but only if the string's 1st(or nore than one) letter are in $position of the $file....
so, after replace, it will be
F0000FF
any one show me how to do that? because I don't know how to use any expression to use the $position var
