on-internet
← Community

Str_Replace is replacing php syntax

Stack Overflow ·

functions/SkriptParser.php <?php $text = file_get_contents(basename($_SERVER['PHP_SELF'])); preg_match_all("/{(.*?)}/", $text, $matches); var_dump($matches[0]); echo str_replace($matches[0],"Test",$text); ?> Is my current code, this is called from my index page which is here: index.php require_once 'functions/SkriptParser.php'; When i open index.php it replace the correct strings [ It'll replace any string inside {} however, it seems to be replacing <?php and I have no clue why. Any ideas?

Comments

Sign in or sign up to comment and upvote.

No comments yet.