From: btanweer at hotmail dot com
Operating system: Linux
PHP version: 4.3.1
PHP Bug Type: Arrays related
Bug description: Unable to retrive page content using "Join" function

Description:
------------
I have written few lines of code to retrive data from Google. It simply
reads the Google search page and then creates an array of all search
listings. This code works on my local machine with Php 4.3.2 in windows
but it does not return any result on my webserver with Php 4.3.1 in linux.
It does not give any error message.

Reproduce code:
---------------
<?

$page =
join("",file("http://www.google.com/search?q=Travel&hl=en&lr=&ie=UTF-8&oe=UTF-8&start=$pagex&sa=N"));


#- Fetch the page and remove newlines
$page = str_replace("\n","",$page);

#- Grab all the website listed on the page
preg_match_all('/<p class=g><a href=(.*?)>(.*?)<\/a><br><font
size=-1>.*?(.*?)<br>.*?(.*?)<br>/',$page,$matches);


$number = count($matches[3]);


for($x=0;$x<$number;$x++)
{
$url = strip_tags($matches[1][$x]);
$title = str_replace("...","",strip_tags($matches[2][$x]));
$description = str_replace("...","",strip_tags($matches[3][$x])
);
$description1 = str_replace("...","",strip_tags($matches[4][$x],"..."));


#- print all the links from array
print "<font size=\"+0\"><a href=$url target=_self
class=\"cnn\">$title</a><br>$description$description1</font><p>\n";

}

?>

Expected result:
----------------
It should display list of search results as seen in Google. For Example:
Title: Travelocity: Airline Tickets, Hotels, Cars, Vacations, and
Decription: Business Travel Center. Save your company money. Find out how.
Alreadya user? Sign-in. Travel Information Center. Departures & Arrivals.


Title: Expedia Travel -- discount airfare, flights, hotels, cars,
Description: Expedia.com is the premier online travel planning and
flight-bookingsite. Purchase airline tickets online, find vacation
packages



Actual result:
--------------
Blank Page

It does not display any error or results at all

--
Edit bug report at [url]http://bugs.php.net/?id=25643&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=25643&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=25643&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=25643&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=25643&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=25643&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=25643&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=25643&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=25643&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=25643&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=25643&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=25643&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=25643&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=25643&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=25643&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=25643&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=25643&r=float[/url]