ID:               38715
 Updated by:       [EMAIL PROTECTED]
 Reported By:      nino at recgr dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Network related
 Operating System: Windows XP
 PHP Version:      5.1.6
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.




Previous Comments:
------------------------------------------------------------------------

[2006-09-04 19:43:16] nino at recgr dot com

Description:
------------
When you put file_get_contents('some_file.ext') as a second argument in
preg_match() it doesn't work. However, when you put that
file_get_contents() into a variable, and THEN you insert that variable
as a second argument, it works. At least at remote files (I'm not sure
about local files) and when there is a third argument too.

Reproduce code:
---------------
preg_match("<pattern>", file_get_contents('http://www.example.com'),
$found);

Expected result:
----------------
Found matches in array $found.

Actual result:
--------------
Nothing.
However, when put your script thus:

$url = file_get_contents('http://www.example.com');

preg_match("<pattern>", $url, $found);

then it works.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=38715&edit=1

Reply via email to