email - Accessing a local file which changes it's name based on date and month in php -


i'm super new php simple enough question pro answer. use got-your-back download specific gmail local machine each morning. today's back-up saved in path gyb/gyb-gmail-backup-xxxxx@gmail.com/2015/5/11 , file 11-81.eml

to test script copied 11-81.eml same folder php file , works fine, having trouble referencing file on local disk.. tomorrow's file in gyb/gyb-gmail-backup-xxxxx@gmail.com/2015/5/12 , file called 12-82.eml

so far have code not seem find file..

$pathname = 'users/????/gyb/gyb-gmail-backup-xxxxx@gmail.com/2015/'.$m .'/'.$d.'/';  echo $pathname; $filename = $pathname.$d.'-81.eml'; $texttofind = "subject:"; $file = new splfileobject($filename); $bort = false; $grabbed = false;  foreach($file $line) { if(strpos($line, $texttofind) !== false) {     $grabbed = $line;       }  } echo $grabbed;     if(strpos($grabbed, "ref12345") === false) {         echo "ref12345 not exist in file";  } 

i have not yet figured out how change -81.eml -82.eml have hunch should not challenging.. tricky bit me referencing exact folder , file.

thank help.. have searched answer requested apologies if super noob question. kind regards p


Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -