views:

73

answers:

1

preg_match_all('|(.*?)|', $read, $foo, PREG_SET_ORDER); print_r($foo);

output as just

Array ( )

Where i made mistake

See guys ,

Actually i want to grab the exact details from this URL

i want to pick this details from this URL

08:35 9W5048 TORONTO EXPECTED 1358 Terminal three

So i tried this snippet , but it throwing Error like

this is my snippet

$read = file_get_contents("http://www.heathrowairport.com/portal/site/heathrow/template.PAGE/menuitem.a43f3a72926ca3b1b0c52a499328c1a0/?javax.portlet.begCacheTok=token&amp;javax.portlet.endCacheTok=token&amp;javax.portlet.tpst=bde211e38117ef94303fde9faca12635&amp;javax.portlet.prp_bde211e38117ef94303fde9faca12635_flightRoute=&amp;javax.portlet.prp_bde211e38117ef94303fde9faca12635_flightNumber=9W5048&amp;javax.portlet.prp_bde211e38117ef94303fde9faca12635_flightTerminal="); //echo $read; preg_match_all('/(.*?)<\/table>/si', $read, $foo, PREG_SET_ORDER); $read1 = $foo[0][0]; preg_match_all('/(.*?)<\/tbody>/si', $read1, $foo1, PREG_SET_ORDER); print_r($foo1[0][0]);

I got Error like

Notice: Undefined offset: 0 in E:\wamp\www\plugin\read-airport-arraiwals.php on line 6

Notice: Undefined offset: 0 in E:\wamp\www\plugin\read-airport-arraiwals.php on line 8
+1  A: 
preg_match_all('/timeTable" .*<tbody>(.*?)<\/table>/smU', $read, $foo, PREG_SET_ORDER);
preg_match_all('/<(th|td).*>(.*)<\/(th|td)>/smU', $foo[0][1], $result, PREG_SET_ORDER);
print_r($result);

And you will get the required data. Quick answer because I don't have time to create a single pattern for that, but this one will do the job.

narcisradu
yes, this what i expected ,i thank to our group
Bharanikumar
Is it possible to make array very simple, That is values in single dimension array
Bharanikumar