I have some code that allows a user to upload an HTML file. I only want what's inside the body tag so I use some string function to strip out the extra pieces.
$output = file_get_contents ($temp_file_name . ".out");
$start = strpos ($output, ">", stripos($output, "<body")) + 1;
$output = substr ($output, $start);
This strips off the first body tag. I'm having a wierd problem with odd characters being inserted however like the following "’" If I echo $output before this code runs, those characters are not there, if I echo afterwards they show up. Here's the really odd part though. If I I echo $output before AND after this code, the odd characters do not show up in either place. I know it sounds screwy, but I've double checked this because I thought I was going insane. Any insight into where these characters are coming from?