The reality of Stefan Scholl

"I hope there's pudding"

"\'" in PHP

$ cat test.php
<?php
$string = "O\'Reilly";
echo $string, "\n";
?>
$ php test.php
O\'Reilly


That's documented but not expected.

Languages like Perl, Python, Ruby, Common Lisp, C, Scheme, OCaml, Erlang, Haskell, Tcl, JavaScript, etc. print the expected "O'Reilly".

One small stone you can stumble on.



Tags: PHP