I have two PHP files and when I fetch data from database on these pages and display them using print_r
both the pages display content in different way.
Actually I have some HTML special characters in my content with I have escaped using htmlspecialchars
before string in MySQL database.
when I fetch them display it on page1.php it is displayed as
My ‘pop’ to display
but on page2.php it is displayed as
My ‘pop’ to display
I also want to mention that page1.php is my webpage and I have print_r just to check the issue on page2.php where page2.php is a api page where I was using echo json_encode to write data but to check the issue I have replaced it with print_r