I would like to use ereg_repace to replace any occurrence of the '_' letter (that isn't preceded by a \) by a '?'
for example the string 'test_' should be converted to 'test?'
but the string 'test\_' should not be matched by the pattern and thus NOT be replaced to 'test\?'
this is what I tried:
Code: Select all
$string = ereg_replace('^[\\]_', '?', $string);any help would be appreciated