View Single Post
  #1 (permalink)  
Old 06-20-09, 05:54 AM
ArbStar ArbStar is offline
New Member
 
Join Date: Jan 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Problem with preg_match_all();

Hi,

I'm making a php page that helps me to get information from other pages,
1 part of the page run successfully,
but the other 2 parts doesn't work !

Here's the code:

PHP Code:

$data=file_get_contents("XXX"); // Here im getting the source of the file that i'll get the information from it

// first part
$t '/<input name="input2" size="100" value="(.+)" dir="ltr">/';  // the string im looking for
preg_match_all($t$data$inputt); // preg_match_all function
$inputt $inputt['0']['0']; // getting the first result

// second part
// same thing, but different string
$p '/<input name="input1" size="100" value="(.+)" dir="ltr">/';
preg_match_all($p$data$input);
$input $input['0']['0'];

// third part
// same thing but different string
$i '/<td rowspan="3"><img src="\.(.+)" border="1" height="150"><\/td>/';
preg_match_all($i$data$url);
$url $url['0']['0'];

echo 
$inputt;
echo 
$input;
echo 
$url
and as you see all the functions and variables are ok and there's no problems with them

but when we come to the output,
i just get the first part output

can you help me finding the mistake in this code

Last edited by ArbStar; 06-20-09 at 05:59 AM.
Reply With Quote