I'm trying to replace something like:
$text = "Hello <--name--> !!";
echo str_replace("--","?",$text);
Expected:
Hello <?name?> !!
Result:
Hello !!
(I'm checking the source code, and I have short open tags enabled)
I have tried so many ways but it seems that I can't never have as result any <?
(or <?php
) string.
I think it may be related to Suhosin patch that is enabled by default in Ubuntu. Before doing anything else, does someone knows how to get that to work?
Thank you.
UPDATE:
I tried directly in command line and it worked. Yea, the problem was that anything between php tags is not displayed in the browser (Chrome), not even in the source code.
echo "A <"."?"."php"." echo 1 "." ?".">"." B";
In Chrome displays "A B" when looking at the source code. But Firefox displays it complete... So in summary Chrome was tricking me ;)
Thank you!!!
Sorry I had to choose the best answer... but for me the 3 answer were correct.