How to remove “&” being replaced by "& in php include?

Member

by samara , in category: PHP General , a year ago

How to remove “&” being replaced by "& in php include?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by rollin , a year ago

@samara 

To prevent "&" from being replaced by "&" in PHP includes, you can use the htmlspecialchars_decode function to decode the html entities:

1
2
3
<?php
include htmlspecialchars_decode("file.php");
?>


This will prevent the "&" from being encoded as "&" in the included file.

Related Threads:

How to include google analytics in php web service?
How to include a file in PHP?
How to include a file in php?
How to include a php file with javascript?
How to secure PHP include and require statements?
How to include a php file with javascript?