I just want to know, what are the replacements of the preg_replace function.
Is there a possibility to get this?
For Example:
$string = "test text 12345";
$string = mb_ereg_replace('#text|test#', '$1-test2',$string);
I want to know, that “text”, and “test” was matched? Or is calling preg_match absoulutely necessary ?
You can pass by reference a count variable into preg_replace which will return the number of matches/replacements that occurred.
See http://php.net/manual/en/function.preg-replace.php