Now this is a very interesting problem that I cannot seem to figure out. I'm desperately hoping someone can solve this for me.
I have 2 variables (the variables are the same name -- it changes as the script goes on). They both have the EXACT same value, yet they do not give the same output.
What this script does is parse through an HTML file (which was an attachment for an e-mail) and pulls out the picture located at http://www.pictures.sprintpcs.com//shareImage/
The first part pulls it out and puts it into $img. The next part I have it hard coded into $img. If I were to echo both of these values, the browser would give me 2 identical URLs. Why does the one that is hard coded work (when I use fpassthru) and then the one that is pulled out of the e-mail NOT work (when I use the same function -- if I were to remove the hard-coded URL line from this script)?
I have the output of the 2 changes of the variables here:
http://www.pixelbin.com/cronmailv2sprint1.php
I hope this made sense! Code is below. For the life of me I cannot figure this out.
$i = 1;
$structure = imap_fetchstructure($imap, $i);
$parse = parser($structure);
$image = find_image($parse);
$image_body = imap_fetchbody($imap, $i, $image['pid']);
$contents = $image_body; // We're not looking at the image.. we're looking at the pictureshare page content.
$loc = "http://pictures.sprintpcs.com//shareImage/";
$find = strpos($contents, $loc);
$new = substr($contents, $find, 300);
$break = explode('"', $new);
$img = trim(stripslashes($break[0]));
echo $img . '<br />';
$img = 'http://pictures.sprintpcs.com//shareImage/18975803906_235.jpg?border=1,255,255,255,1,0,0,0&invite=7ET22yJz8PYGOkOLa8qh';
echo $img . '<br />';
$fp = fopen($img, 'rb');
$image = fpassthru($fp);
echo imap_base64($image);
--Edit:--
Even any ideas of what I could try would be greatly appreciated. Thanks