0

In my functions.php I added a function that replaces English with German quotation marks. I do this by simple str_replace calls, like this:

 $content = str_replace (' “', ' „', $content);

Now I want to do this with preg_replace instead so I can handle special cases differently. However, this:

 $haekchenunten = "“";
 $regex = /^ . $haekchenunten . /;
 $content = preg_replace ($regex, '„', $content);

Leads to a blank page (PHP Fatal, I'd presume).

How can I use “ with preg_replace?

Peter O.
  • 32,158
  • 14
  • 82
  • 96
jekyll
  • 78
  • 1
  • 10

1 Answers1

0

If this is your code, try to use quotation ;-)

 $regex = "/^" . $haekchenunten . "/";
Trendfischer
  • 7,112
  • 5
  • 40
  • 51