supposedly current unchanging countenance doesn't relapse any information php
i am controlling following code:
<?php
$stock = $_get[s]; //returns batch ticker representation eg goog yhoo
$first = $stock[0];
$url = "http://biz.yahoo.com/research/earncal/".$first."/".$stock.".html";
$data = file_get_contents($url);
$r_header = '/prev. week(.+?)next week/';
$r_date = '/\<b\>(.+?)\<\/b\>/';
preg_match($r_header,$data,$header);
preg_match($r_date, $header[1], $date);
echo $date[1];
?>
i've checked unchanging expressions seem valid. i check only $url $data out justly i imitation $data check source formula i'm looking regex there. you're prying checking anything, an instance repremand url
i've attempted all i cruise of, including both var_dump($header) var_dump($date), both relapse lifeless arrays.
i have means emanate unchanging expressions works. instance, following justly advantage "earnings":
$r_header = '/company (.+?) calendar/';
preg_match($r_header,$data,$header);
echo $header[1];
i am going nuts perplexing figure out since isn't working. any assistance awesome. thanks.
Comments
Post a Comment